mirror of
https://github.com/docker/login-action.git
synced 2026-10-17 03:43:07 +01:00
Merge pull request #1089 from crazy-max/fix-registry-auth-ecr-false
preserve explicit ECR settings in registry-auth
This commit is contained in:
@@ -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
2
dist/index.cjs
generated
vendored
File diff suppressed because one or more lines are too long
4
dist/index.cjs.map
generated
vendored
4
dist/index.cjs.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -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)
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user