fix ci_registry_password

This commit is contained in:
David Hiendl 2023-12-02 19:47:16 +01:00
parent e51914fbe7
commit c4e48e687b
3 changed files with 61950 additions and 68935 deletions

130871
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
"description": "",
"main": "src/index.js",
"scripts": {
"bundle": "npm run format:write && npm run package",
"bundle": "npm run package",
"ci-test": "jest",
"format:write": "prettier --write **/*.js",
"format:check": "prettier --check **/*.js",

View File

@ -33,18 +33,14 @@ export function addCiRegistryAuth(ci_registry, registryAuthJson) {
return;
}
if (
process.env['CI_REGISTRY_PASSWORD'] == null ||
process.env['CI_REGISTRY_PASSWORD'].length > 0
) {
console.log(
'WARNING: add_ci_registry_auth enabled but CI_REGISTRY_PASSWORD env is empty'
);
const argCiRegistryPassword = (core.getInput('ci_registry_password') ?? '').trim();
if (argCiRegistryPassword == null || argCiRegistryPassword.length <= 0) {
console.log('WARNING: add_ci_registry_auth enabled but ci_registry_password env is empty');
return;
}
registryAuthJson.auths[ci_registry] = base64ToBytes(
'token:' + process.env['CI_REGISTRY_PASSWORD']
'token:' + argCiRegistryPassword
);
}