mirror of
https://gitea.com/actions/setup-java.git
synced 2025-11-02 07:47:06 +00:00
generated and pretty files
This commit is contained in:
@@ -22,14 +22,14 @@ const core = __importStar(require("@actions/core"));
|
||||
const io = __importStar(require("@actions/io"));
|
||||
exports.M2_DIR = '.m2';
|
||||
exports.SETTINGS_FILE = 'settings.xml';
|
||||
function configAuthentication(username, password) {
|
||||
function configAuthentication(id, username, password) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (username && password) {
|
||||
if (id && username && password) {
|
||||
core.debug(`configAuthentication with ${username} and a password`);
|
||||
const directory = path.join(os.homedir(), exports.M2_DIR);
|
||||
yield io.mkdirP(directory);
|
||||
core.debug(`created directory ${directory}`);
|
||||
yield write(directory, generate(username, password));
|
||||
yield write(directory, generate(id, username, password));
|
||||
}
|
||||
else {
|
||||
core.debug(`no auth without username: ${username} and password: ${password}`);
|
||||
@@ -38,11 +38,12 @@ function configAuthentication(username, password) {
|
||||
}
|
||||
exports.configAuthentication = configAuthentication;
|
||||
// only exported for testing purposes
|
||||
function generate(username, password) {
|
||||
function generate(id, username, password) {
|
||||
return `
|
||||
<settings>
|
||||
<servers>
|
||||
<server>
|
||||
<id>${id}</id>
|
||||
<username>${username}</username>
|
||||
<password>${password}</password>
|
||||
</server>
|
||||
|
||||
Reference in New Issue
Block a user