mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 01:46:46 +00:00
fix(auth): Update authentication logic in settings.xml, unit tests (#1)
* fix(auth): Update authentication logic in settings.xml, unit tests Enhanced the logic for reading authentication information in the settings.xml file to address an issue where attempts to configure a GitHub Action for fetching packages from a repository within the same organization resulted in authentication errors. Despite the correct configuration, the process failed with a 401 Unauthorized status during dependency download from GitHub's Maven package repository. The error was pinpointed to a non-resolvable parent POM due to authentication failure, with an incorrect 'parent.relativePath' exacerbating the issue. To resolve this, I made significant updates to the logic within settings.xml for better handling of authentication information. Additionally, unit tests have been updated to reflect these changes and ensure robust verification. The documentation and examples have also been revised to provide clearer guidance on configuring and utilizing this updated process successfully.
This commit is contained in:
parent
9704b39bf2
commit
c0786a2b6c
5 changed files with 58 additions and 24 deletions
8
dist/setup/index.js
vendored
8
dist/setup/index.js
vendored
|
@ -122463,9 +122463,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.generate = exports.createAuthenticationSettings = exports.configureAuthentication = void 0;
|
||||
const path = __importStar(__nccwpck_require__(71017));
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
const io = __importStar(__nccwpck_require__(47351));
|
||||
const path = __importStar(__nccwpck_require__(71017));
|
||||
const fs = __importStar(__nccwpck_require__(57147));
|
||||
const os = __importStar(__nccwpck_require__(22037));
|
||||
const xmlbuilder2_1 = __nccwpck_require__(70151);
|
||||
|
@ -122517,8 +122517,8 @@ function generate(id, username, password, gpgPassphrase) {
|
|||
server: [
|
||||
{
|
||||
id: id,
|
||||
username: `\${env.${username}}`,
|
||||
password: `\${env.${password}}`
|
||||
username: process.env[username],
|
||||
password: process.env[password]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -122527,7 +122527,7 @@ function generate(id, username, password, gpgPassphrase) {
|
|||
if (gpgPassphrase) {
|
||||
const gpgServer = {
|
||||
id: 'gpg.passphrase',
|
||||
passphrase: `\${env.${gpgPassphrase}}`
|
||||
passphrase: process.env[gpgPassphrase]
|
||||
};
|
||||
xmlObj.settings.servers.server.push(gpgServer);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue