Merge pull request #1089 from crazy-max/fix-registry-auth-ecr-false

preserve explicit ECR settings in registry-auth
This commit is contained in:
CrazyMax
2026-10-16 20:24:38 +02:00
committed by GitHub
4 changed files with 24 additions and 4 deletions

View File

@@ -168,3 +168,23 @@ test('getAuthList masks registry-auth password when present', async () => {
expect(stdoutWriteSpy.mock.calls.map(call => call[0]).join('')).toContain('::add-mask::groundcontrol'); expect(stdoutWriteSpy.mock.calls.map(call => call[0]).join('')).toContain('::add-mask::groundcontrol');
}); });
// prettier-ignore
test.each([
['false', 'false'],
['"false"', 'false'],
['true', 'true'],
['auto', 'auto'],
['""', 'auto']
])('getAuthList normalizes registry-auth ecr: %s', (ecr, expected) => {
const [auth] = getAuthList({
registry: '',
username: '',
password: '',
scope: '',
ecr: '',
logout: true,
registryAuth: `- registry: 012345678910.dkr.ecr.eu-west-3.amazonaws.com\n username: AWS\n password: token\n ecr: ${ecr}\n`
});
expect(auth.ecr).toBe(expected);
});

2
dist/index.cjs generated vendored

File diff suppressed because one or more lines are too long

4
dist/index.cjs.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -62,7 +62,7 @@ export function getAuthList(inputs: Inputs): Array<Auth> {
username: auth.username, username: auth.username,
password: auth.password, password: auth.password,
scope: auth.scope, scope: auth.scope,
ecr: auth.ecr || 'auto', ecr: String(auth.ecr ?? '') || 'auto',
configDir: scopeToConfigDir(registry, auth.scope) configDir: scopeToConfigDir(registry, auth.scope)
}; };
}); });