bugfix(auth): Update authentication logic in settings.xml, unit tests, and documentation examples

To address this issue, we've implemented substantial enhancements to the logic within settings.xml to improve the management of authentication data. Furthermore, we've updated the unit tests to align with these modifications, guaranteeing thorough validation. The documentation and examples have been meticulously revised to offer more straightforward instructions on how to effectively configure and employ this updated methodology.
This commit is contained in:
Parry 2024-03-01 12:43:13 +08:00
parent 9704b39bf2
commit 0185e0f794
No known key found for this signature in database
GPG key ID: B9795B3F9F07BF96
5 changed files with 66 additions and 20 deletions

View file

@ -1,6 +1,6 @@
import * as path from 'path';
import * as core from '@actions/core';
import * as io from '@actions/io';
import * as path from 'path';
import * as fs from 'fs';
import * as os from 'os';
@ -84,8 +84,8 @@ export function generate(
server: [
{
id: id,
username: `\${env.${username}}`,
password: `\${env.${password}}`
username: process.env['username'],
password: process.env['password']
}
]
}
@ -95,7 +95,7 @@ export function generate(
if (gpgPassphrase) {
const gpgServer = {
id: 'gpg.passphrase',
passphrase: `\${env.${gpgPassphrase}}`
passphrase: process.env['gpgPassphrase']
};
xmlObj.settings.servers.server.push(gpgServer);
}