Skip to content

Commit 2a69be2

Browse files
YunaBraskabrunoborgesCopilotCopilot
authored
feat: support Maven server credential origins (#1282)
* feat: support Maven server credential origins * Refactor origin construction to include port if necessary Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: validate Maven server credential origins * docs: note mvn-server-repository-origins requires Maven 3.10+ Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Bruno Borges <bruno.borges@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Bruno Borges <brborges@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent d0e6e4d commit 2a69be2

9 files changed

Lines changed: 342 additions & 38 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ steps:
168168
| `server-username-env-var` | Environment variable name for Maven repository username. | `GITHUB_ACTOR` |
169169
| `server-password-env-var` | Environment variable name for Maven repository password or token. | `GITHUB_TOKEN` |
170170
| `mvn-server-credentials` | Multiline Maven server credentials in the format `server-id:USERNAME_ENV:PASSWORD_ENV`. Replaces the single server configured by the three inputs above when set. | |
171+
| `mvn-server-repository-origins` | Multiline Maven credential origins in the format `server-id:repository-origin`. Each origin must belong to a configured server ID. Requires Maven 3.10+. | |
171172
| `mvn-repositories` | Multiline Maven dependency repositories in the format `repository-id:repository-url:snapshots-enabled`. | |
172173
| `mvn-repositories-include-central` | Include Maven Central in the generated dependency repositories profile. When `false`, Central is disabled unless an explicit `central` repository is declared. | `true` |
173174
| `mvn-repositories-prioritize-central` | Place Maven Central before custom dependency repositories. Has no effect when Maven Central is excluded. | `true` |

‎__tests__/auth.test.ts‎

Lines changed: 127 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,21 @@ describe('auth tests', () => {
318318
).toEqual(expectedSettings);
319319
});
320320

321+
it('generates repository origins for a Maven server', () => {
322+
const settings = auth.generate([
323+
{
324+
id: 'central',
325+
usernameEnvVar: 'CENTRAL_USER',
326+
passwordEnvVar: 'CENTRAL_PASS',
327+
repositoryOrigins: ['https://central.sonatype.com']
328+
}
329+
]);
330+
331+
expect(settings).toContain(` <repositoryOrigins>
332+
<repositoryOrigin>https://central.sonatype.com</repositoryOrigin>
333+
</repositoryOrigins>`);
334+
});
335+
321336
it('does not add a gpg profile when the passphrase env var is the maven-gpg-plugin default', () => {
322337
const id = 'packages';
323338
const username = 'USER';
@@ -749,16 +764,23 @@ describe('auth tests', () => {
749764
});
750765

751766
it('uses multiline Maven server credentials instead of single-server inputs', () => {
752-
(core.getMultilineInput as jest.Mock).mockReturnValue([
753-
'releases:RELEASES_USERNAME:RELEASES_PASSWORD',
754-
'snapshots:SNAPSHOTS_USERNAME:SNAPSHOTS_PASSWORD'
755-
]);
767+
(core.getMultilineInput as jest.Mock).mockImplementation((name: string) =>
768+
name === 'mvn-server-credentials'
769+
? [
770+
'releases:RELEASES_USERNAME:RELEASES_PASSWORD',
771+
'snapshots:SNAPSHOTS_USERNAME:SNAPSHOTS_PASSWORD'
772+
]
773+
: name === 'mvn-server-repository-origins'
774+
? ['releases:https://repo.example.com']
775+
: []
776+
);
756777

757778
expect(auth.getMavenServerSettings()).toEqual([
758779
{
759780
id: 'releases',
760781
usernameEnvVar: 'RELEASES_USERNAME',
761-
passwordEnvVar: 'RELEASES_PASSWORD'
782+
passwordEnvVar: 'RELEASES_PASSWORD',
783+
repositoryOrigins: ['https://repo.example.com']
762784
},
763785
{
764786
id: 'snapshots',
@@ -803,6 +825,106 @@ describe('auth tests', () => {
803825
expect(core.warning).toHaveBeenCalledTimes(2);
804826
});
805827

828+
it('adds normalized repository origins to matching Maven servers', () => {
829+
expect(
830+
auth.addMavenServerRepositoryOrigins(
831+
[
832+
{
833+
id: 'central',
834+
usernameEnvVar: 'CENTRAL_USER',
835+
passwordEnvVar: 'CENTRAL_PASS'
836+
},
837+
{
838+
id: 'packages',
839+
usernameEnvVar: 'GITHUB_ACTOR',
840+
passwordEnvVar: 'GITHUB_TOKEN'
841+
}
842+
],
843+
[
844+
'central:https://central.sonatype.com/',
845+
'central:https://central.sonatype.com',
846+
'central:https://central.sonatype.com:443',
847+
'packages:https://maven.pkg.github.com',
848+
'packages:ssh://packages.example.com:22',
849+
'packages:ftp://packages.example.com:21'
850+
]
851+
)
852+
).toEqual([
853+
{
854+
id: 'central',
855+
usernameEnvVar: 'CENTRAL_USER',
856+
passwordEnvVar: 'CENTRAL_PASS',
857+
repositoryOrigins: ['https://central.sonatype.com']
858+
},
859+
{
860+
id: 'packages',
861+
usernameEnvVar: 'GITHUB_ACTOR',
862+
passwordEnvVar: 'GITHUB_TOKEN',
863+
repositoryOrigins: [
864+
'https://maven.pkg.github.com',
865+
'ssh://packages.example.com:22',
866+
'ftp://packages.example.com:21'
867+
]
868+
}
869+
]);
870+
});
871+
872+
it.each([
873+
{
874+
entries: ['central'],
875+
error:
876+
'Invalid mvn-server-repository-origins entry at line 1. Expected format: server-id:repository-origin'
877+
},
878+
{
879+
entries: ['other:https://repo.example.com'],
880+
error:
881+
"Unknown server-id 'other' in mvn-server-repository-origins at line 1"
882+
},
883+
{
884+
entries: ['central:https://repo.example.com/path'],
885+
error:
886+
"Invalid repository origin 'https://repo.example.com/path' in mvn-server-repository-origins at line 1"
887+
},
888+
{
889+
entries: ['central:https:repo.example.com'],
890+
error:
891+
"Invalid repository origin 'https:repo.example.com' in mvn-server-repository-origins at line 1"
892+
},
893+
{
894+
entries: ['central:https:/repo.example.com'],
895+
error:
896+
"Invalid repository origin 'https:/repo.example.com' in mvn-server-repository-origins at line 1"
897+
},
898+
{
899+
entries: ['central:https://repo.example.com?'],
900+
error:
901+
"Invalid repository origin 'https://repo.example.com?' in mvn-server-repository-origins at line 1"
902+
},
903+
{
904+
entries: ['central:https://repo.example.com#'],
905+
error:
906+
"Invalid repository origin 'https://repo.example.com#' in mvn-server-repository-origins at line 1"
907+
},
908+
{
909+
entries: ['central:https://@repo.example.com'],
910+
error:
911+
"Invalid repository origin 'https://@repo.example.com' in mvn-server-repository-origins at line 1"
912+
}
913+
])('rejects invalid Maven server repository origins', ({entries, error}) => {
914+
expect(() =>
915+
auth.addMavenServerRepositoryOrigins(
916+
[
917+
{
918+
id: 'central',
919+
usernameEnvVar: 'CENTRAL_USER',
920+
passwordEnvVar: 'CENTRAL_PASS'
921+
}
922+
],
923+
entries
924+
)
925+
).toThrow(error);
926+
});
927+
806928
function xmlElementText(xml: string, tagName: string): string {
807929
const match = new RegExp(`<${tagName}>([\\s\\S]*?)</${tagName}>`).exec(xml);
808930
expect(match).not.toBeNull();

‎action.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ inputs:
6666
mvn-server-credentials:
6767
description: 'Multiline list of Maven server credentials in the format `server-id:USERNAME_ENV:PASSWORD_ENV`. When set, replaces the single server configured by server-id, server-username-env-var, and server-password-env-var.'
6868
required: false
69+
mvn-server-repository-origins:
70+
description: 'Multiline list of Maven credential origins in the format `server-id:repository-origin`. Each origin must belong to a configured server ID. Requires Maven 3.10+.'
71+
required: false
6972
mvn-repositories:
7073
description: 'Multiline list of Maven dependency repositories in the format `repository-id:repository-url:snapshots-enabled`.'
7174
required: false

‎dist/cleanup/index.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31040,7 +31040,7 @@ module.exports = {
3104031040
/* harmony export */ gk: () => (/* binding */ INPUT_CACHE),
3104131041
/* harmony export */ wG: () => (/* binding */ INPUT_JOB_STATUS)
3104231042
/* harmony export */ });
31043-
/* unused harmony exports MACOS_JAVA_CONTENT_POSTFIX, INPUT_JAVA_VERSION, INPUT_JAVA_VERSION_FILE, INPUT_ARCHITECTURE, INPUT_JAVA_PACKAGE, INPUT_DISTRIBUTION, INPUT_JDK_FILE, INPUT_JDK_FILE_DEPRECATED, INPUT_CHECK_LATEST, INPUT_FORCE_DOWNLOAD, INPUT_SET_DEFAULT, INPUT_PROBLEM_MATCHER, INPUT_VERIFY_SIGNATURE, INPUT_VERIFY_SIGNATURE_PUBLIC_KEY, SIGNATURE_VERIFICATION_DOCUMENTATION_URL, SIGNATURE_VERIFICATION_FAILURE_HELP, INPUT_MVN_SERVER_CREDENTIALS, INPUT_MVN_REPOSITORIES, INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL, INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL, INPUT_SERVER_ID, INPUT_SERVER_USERNAME_ENV_VAR, INPUT_SERVER_PASSWORD_ENV_VAR, INPUT_SERVER_USERNAME_DEPRECATED, INPUT_SERVER_PASSWORD_DEPRECATED, INPUT_SETTINGS_PATH, INPUT_OVERWRITE_SETTINGS, INPUT_GPG_PRIVATE_KEY, INPUT_GPG_PASSPHRASE_ENV_VAR, INPUT_GPG_PASSPHRASE_DEPRECATED, INPUT_DEFAULT_SERVER_USERNAME, INPUT_DEFAULT_SERVER_PASSWORD, INPUT_DEFAULT_GPG_PRIVATE_KEY, INPUT_DEFAULT_GPG_PASSPHRASE, MAVEN_GPG_PASSPHRASE_DEFAULT_ENV, GPG_PASSPHRASE_PROFILE_ID, MAVEN_REPOSITORIES_PROFILE_ID, MAVEN_CENTRAL_REPOSITORY_ID, MAVEN_CENTRAL_REPOSITORY_URL, INPUT_CACHE_DEPENDENCY_PATH, INPUT_CACHE_PATH, M2_DIR, MVN_SETTINGS_FILE, MVN_TOOLCHAINS_FILE, INPUT_MVN_TOOLCHAIN_ID, INPUT_MVN_TOOLCHAIN_VENDOR, INPUT_SHOW_DOWNLOAD_PROGRESS, MAVEN_ARGS_ENV, MAVEN_NO_TRANSFER_PROGRESS_FLAG, MAVEN_NO_TRANSFER_PROGRESS_LONG_FLAG, DISTRIBUTIONS_ONLY_MAJOR_VERSION */
31043+
/* unused harmony exports MACOS_JAVA_CONTENT_POSTFIX, INPUT_JAVA_VERSION, INPUT_JAVA_VERSION_FILE, INPUT_ARCHITECTURE, INPUT_JAVA_PACKAGE, INPUT_DISTRIBUTION, INPUT_JDK_FILE, INPUT_JDK_FILE_DEPRECATED, INPUT_CHECK_LATEST, INPUT_FORCE_DOWNLOAD, INPUT_SET_DEFAULT, INPUT_PROBLEM_MATCHER, INPUT_VERIFY_SIGNATURE, INPUT_VERIFY_SIGNATURE_PUBLIC_KEY, SIGNATURE_VERIFICATION_DOCUMENTATION_URL, SIGNATURE_VERIFICATION_FAILURE_HELP, INPUT_MVN_SERVER_CREDENTIALS, INPUT_MVN_SERVER_REPOSITORY_ORIGINS, INPUT_MVN_REPOSITORIES, INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL, INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL, INPUT_SERVER_ID, INPUT_SERVER_USERNAME_ENV_VAR, INPUT_SERVER_PASSWORD_ENV_VAR, INPUT_SERVER_USERNAME_DEPRECATED, INPUT_SERVER_PASSWORD_DEPRECATED, INPUT_SETTINGS_PATH, INPUT_OVERWRITE_SETTINGS, INPUT_GPG_PRIVATE_KEY, INPUT_GPG_PASSPHRASE_ENV_VAR, INPUT_GPG_PASSPHRASE_DEPRECATED, INPUT_DEFAULT_SERVER_USERNAME, INPUT_DEFAULT_SERVER_PASSWORD, INPUT_DEFAULT_GPG_PRIVATE_KEY, INPUT_DEFAULT_GPG_PASSPHRASE, MAVEN_GPG_PASSPHRASE_DEFAULT_ENV, GPG_PASSPHRASE_PROFILE_ID, MAVEN_REPOSITORIES_PROFILE_ID, MAVEN_CENTRAL_REPOSITORY_ID, MAVEN_CENTRAL_REPOSITORY_URL, INPUT_CACHE_DEPENDENCY_PATH, INPUT_CACHE_PATH, M2_DIR, MVN_SETTINGS_FILE, MVN_TOOLCHAINS_FILE, INPUT_MVN_TOOLCHAIN_ID, INPUT_MVN_TOOLCHAIN_VENDOR, INPUT_SHOW_DOWNLOAD_PROGRESS, MAVEN_ARGS_ENV, MAVEN_NO_TRANSFER_PROGRESS_FLAG, MAVEN_NO_TRANSFER_PROGRESS_LONG_FLAG, DISTRIBUTIONS_ONLY_MAJOR_VERSION */
3104431044
const MACOS_JAVA_CONTENT_POSTFIX = 'Contents/Home';
3104531045
const INPUT_JAVA_VERSION = 'java-version';
3104631046
const INPUT_JAVA_VERSION_FILE = 'java-version-file';
@@ -31058,6 +31058,7 @@ const INPUT_VERIFY_SIGNATURE_PUBLIC_KEY = 'verify-signature-public-key';
3105831058
const SIGNATURE_VERIFICATION_DOCUMENTATION_URL = 'https://github.com/actions/setup-java#download-integrity-and-signatures';
3105931059
const SIGNATURE_VERIFICATION_FAILURE_HELP = (/* unused pure expression or super */ null && (`If this is a legitimate vendor signing-key rotation, see ${SIGNATURE_VERIFICATION_DOCUMENTATION_URL} for instructions to configure the updated public key or temporarily disable signature verification.`));
3106031060
const INPUT_MVN_SERVER_CREDENTIALS = 'mvn-server-credentials';
31061+
const INPUT_MVN_SERVER_REPOSITORY_ORIGINS = 'mvn-server-repository-origins';
3106131062
const INPUT_MVN_REPOSITORIES = 'mvn-repositories';
3106231063
const INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL = 'mvn-repositories-include-central';
3106331064
const INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL = 'mvn-repositories-prioritize-central';

‎dist/setup/81.index.js‎

Lines changed: 76 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const modules = {
77

88
__webpack_require__.r(__webpack_exports__);
99
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
10+
/* harmony export */ addMavenServerRepositoryOrigins: () => (/* binding */ addMavenServerRepositoryOrigins),
1011
/* harmony export */ configureAuthentication: () => (/* binding */ configureAuthentication),
1112
/* harmony export */ createAuthenticationSettings: () => (/* binding */ createAuthenticationSettings),
1213
/* harmony export */ generate: () => (/* binding */ generate),
@@ -37,6 +38,7 @@ __webpack_require__.r(__webpack_exports__);
3738

3839

3940

41+
const MAVEN_REPOSITORY_ORIGIN = /^[A-Za-z][A-Za-z0-9+.-]*:\/\/[^/?#@]+\/?$/;
4042
async function configureAuthentication() {
4143
const servers = getMavenServerSettings();
4244
const repositorySettings = getMavenRepositorySettings();
@@ -74,16 +76,16 @@ function getInputWithDeprecatedAlias(inputName, deprecatedInputName, defaultValu
7476
// only exported for testing purposes
7577
function getMavenServerSettings() {
7678
const entries = _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getMultilineInput */ .q3(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_SERVER_CREDENTIALS */ .MM);
77-
if (entries.some(entry => entry.trim())) {
78-
return parseMavenServerCredentials(entries);
79-
}
80-
return [
81-
{
82-
id: _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getInput */ .V4(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_ID */ .fd),
83-
usernameEnvVar: getInputWithDeprecatedAlias(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_USERNAME_ENV_VAR */ .sc, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_USERNAME_DEPRECATED */ .sp, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_DEFAULT_SERVER_USERNAME */ .Wj),
84-
passwordEnvVar: getInputWithDeprecatedAlias(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_PASSWORD_ENV_VAR */ .r4, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_PASSWORD_DEPRECATED */ .Vt, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_DEFAULT_SERVER_PASSWORD */ .xp)
85-
}
86-
];
79+
const servers = entries.some(entry => entry.trim())
80+
? parseMavenServerCredentials(entries)
81+
: [
82+
{
83+
id: _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getInput */ .V4(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_ID */ .fd),
84+
usernameEnvVar: getInputWithDeprecatedAlias(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_USERNAME_ENV_VAR */ .sc, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_USERNAME_DEPRECATED */ .sp, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_DEFAULT_SERVER_USERNAME */ .Wj),
85+
passwordEnvVar: getInputWithDeprecatedAlias(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_PASSWORD_ENV_VAR */ .r4, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SERVER_PASSWORD_DEPRECATED */ .Vt, _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_DEFAULT_SERVER_PASSWORD */ .xp)
86+
}
87+
];
88+
return addMavenServerRepositoryOrigins(servers, _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getMultilineInput */ .q3(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_SERVER_REPOSITORY_ORIGINS */ .gR));
8789
}
8890
// only exported for testing purposes
8991
function parseMavenServerCredentials(entries) {
@@ -110,6 +112,61 @@ function parseMavenServerCredentials(entries) {
110112
return servers;
111113
}
112114
// only exported for testing purposes
115+
function addMavenServerRepositoryOrigins(servers, entries) {
116+
const serverIds = new Set(servers.map(server => server.id));
117+
const originsByServer = new Map();
118+
entries.forEach((entry, index) => {
119+
if (!entry.trim()) {
120+
return;
121+
}
122+
const separator = entry.indexOf(':');
123+
if (separator <= 0 || separator === entry.length - 1) {
124+
throw new Error(`Invalid mvn-server-repository-origins entry at line ${index + 1}. Expected format: server-id:repository-origin`);
125+
}
126+
const id = entry.slice(0, separator).trim();
127+
const value = entry.slice(separator + 1).trim();
128+
if (!id || !value) {
129+
throw new Error(`Invalid mvn-server-repository-origins entry at line ${index + 1}. Server ID and repository origin are required`);
130+
}
131+
if (!serverIds.has(id)) {
132+
throw new Error(`Unknown server-id '${id}' in mvn-server-repository-origins at line ${index + 1}`);
133+
}
134+
let url;
135+
try {
136+
if (!MAVEN_REPOSITORY_ORIGIN.test(value)) {
137+
throw new Error();
138+
}
139+
url = new URL(value);
140+
}
141+
catch {
142+
throw new Error(`Invalid repository origin '${value}' in mvn-server-repository-origins at line ${index + 1}`);
143+
}
144+
if (!url.host ||
145+
url.username ||
146+
url.password ||
147+
(url.pathname !== '' && url.pathname !== '/') ||
148+
url.search ||
149+
url.hash) {
150+
throw new Error(`Invalid repository origin '${value}' in mvn-server-repository-origins at line ${index + 1}`);
151+
}
152+
const explicitPort = /:(\d+)\/?$/.exec(value)?.[1];
153+
const port = explicitPort ? Number.parseInt(explicitPort, 10) : undefined;
154+
const includePort = port !== undefined &&
155+
!((url.protocol === 'http:' && port === 80) ||
156+
(url.protocol === 'https:' && port === 443));
157+
const origin = `${url.protocol}//${url.hostname}${includePort ? `:${port}` : ''}`;
158+
const origins = originsByServer.get(id) || [];
159+
if (!origins.includes(origin)) {
160+
origins.push(origin);
161+
originsByServer.set(id, origins);
162+
}
163+
});
164+
return servers.map(server => {
165+
const repositoryOrigins = originsByServer.get(server.id);
166+
return repositoryOrigins ? { ...server, repositoryOrigins } : server;
167+
});
168+
}
169+
// only exported for testing purposes
113170
function getMavenRepositorySettings() {
114171
const entries = _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getMultilineInput */ .q3(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_REPOSITORIES */ .W2);
115172
if (!entries.some(entry => entry.trim())) {
@@ -187,7 +244,15 @@ function generate(servers, gpgPassphraseEnvVar, repositorySettings) {
187244
' <servers>'
188245
];
189246
for (const server of servers) {
190-
lines.push(' <server>', ` <id>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(server.id)}</id>`, ` <username>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(`\${env.${server.usernameEnvVar}}`)}</username>`, ` <password>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(`\${env.${server.passwordEnvVar}}`)}</password>`, ' </server>');
247+
lines.push(' <server>', ` <id>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(server.id)}</id>`, ` <username>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(`\${env.${server.usernameEnvVar}}`)}</username>`, ` <password>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(`\${env.${server.passwordEnvVar}}`)}</password>`);
248+
if (server.repositoryOrigins) {
249+
lines.push(' <repositoryOrigins>');
250+
for (const origin of server.repositoryOrigins) {
251+
lines.push(` <repositoryOrigin>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(origin)}</repositoryOrigin>`);
252+
}
253+
lines.push(' </repositoryOrigins>');
254+
}
255+
lines.push(' </server>');
191256
}
192257
lines.push(' </servers>');
193258
if (repositorySettings || includeGpgPassphraseProfile) {

‎dist/setup/index.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31060,6 +31060,7 @@ module.exports = {
3106031060
/* harmony export */ af: () => (/* binding */ INPUT_JAVA_VERSION_FILE),
3106131061
/* harmony export */ db: () => (/* binding */ INPUT_GPG_PASSPHRASE_ENV_VAR),
3106231062
/* harmony export */ fd: () => (/* binding */ INPUT_SERVER_ID),
31063+
/* harmony export */ gR: () => (/* binding */ INPUT_MVN_SERVER_REPOSITORY_ORIGINS),
3106331064
/* harmony export */ g_: () => (/* binding */ INPUT_DISTRIBUTION),
3106431065
/* harmony export */ gk: () => (/* binding */ INPUT_CACHE),
3106531066
/* harmony export */ hq: () => (/* binding */ MAVEN_REPOSITORIES_PROFILE_ID),
@@ -31106,6 +31107,7 @@ const INPUT_VERIFY_SIGNATURE_PUBLIC_KEY = 'verify-signature-public-key';
3110631107
const SIGNATURE_VERIFICATION_DOCUMENTATION_URL = 'https://github.com/actions/setup-java#download-integrity-and-signatures';
3110731108
const SIGNATURE_VERIFICATION_FAILURE_HELP = `If this is a legitimate vendor signing-key rotation, see ${SIGNATURE_VERIFICATION_DOCUMENTATION_URL} for instructions to configure the updated public key or temporarily disable signature verification.`;
3110831109
const INPUT_MVN_SERVER_CREDENTIALS = 'mvn-server-credentials';
31110+
const INPUT_MVN_SERVER_REPOSITORY_ORIGINS = 'mvn-server-repository-origins';
3110931111
const INPUT_MVN_REPOSITORIES = 'mvn-repositories';
3111031112
const INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL = 'mvn-repositories-include-central';
3111131113
const INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL = 'mvn-repositories-prioritize-central';

0 commit comments

Comments
 (0)