Skip to content

Commit

Permalink
fix: add-mask to login outputs
Browse files Browse the repository at this point in the history
Signed-off-by: smcavallo <[email protected]>
  • Loading branch information
smcavallo committed Jan 18, 2022
1 parent 4831715 commit 45a78e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ async function run() {
}

const secretSuffix = replaceSpecialCharacters(registryUri)
core.setSecret(creds[0])
core.setSecret(creds[1])
core.setOutput(`docker_username_${secretSuffix}`, creds[0]);
core.setOutput(`docker_password_${secretSuffix}`, creds[1]);

Expand Down
4 changes: 4 additions & 0 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ describe('Login to ECR', () => {
});

await run();
expect(core.setSecret).toHaveBeenNthCalledWith(1, 'hello');
expect(core.setSecret).toHaveBeenNthCalledWith(2, 'world');
expect(core.setSecret).toHaveBeenNthCalledWith(3, 'foo');
expect(core.setSecret).toHaveBeenNthCalledWith(4, 'bar');
expect(core.setOutput).toHaveBeenNthCalledWith(1, 'docker_username_123456789012_dkr_ecr_aws_region_1_amazonaws_com', 'hello');
expect(core.setOutput).toHaveBeenNthCalledWith(2, 'docker_password_123456789012_dkr_ecr_aws_region_1_amazonaws_com', 'world');
expect(core.setOutput).toHaveBeenNthCalledWith(3, 'docker_username_111111111111_dkr_ecr_aws_region_1_amazonaws_com', 'foo');
Expand Down

0 comments on commit 45a78e2

Please sign in to comment.