Closed rbellamy closed 4 years ago
Interesting, I was not able to reproduce that behavior in the " Login to Amazon ECR using explicit registry ID" step here: https://github.com/aws-actions/amazon-ecr-login/runs/453675212?check_suite_focus=true
Was there possibly extra whitespace around the registry ID in your workflow file? If you have CloudTrail turned on in your account, it would also be great to know what value the GetAuthorizationToken is actually receiving.
Good questions. There may have been a space in the ID. Also, I'm running in a self-hosted runner, and that runner is using an Instance Profile, so I'm not using the configure-aws-credentials
action, therefore, am entering the registryId
directly.
As for CloudTrail - the only events I see are from the successful push, which leads me to believe the action is targeting an invalid endpoint.
It looks like the Actions core library trims all inputs anyway, so I don't think an extra space would be the problem. https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L74
It also looks like GetAuthorizationToken calls with invalid parameters don't actually get logged in CloudTrail. When I do aws ecr get-authorization-token --registry-ids 123456 --region us-west-2
manually, the call does not get logged, only successful calls.
Anyway, I added some debugging statements on the master branch to print out the actual registry IDs used in the call. In order to see them, you can set the secret ACTIONS_STEP_DEBUG
to true in your repository and use aws-actions/amazon-ecr-login@master
in your workflow file.
The debugging change has been deployed to the v1 tag
my account ID starts with 0 and in debug mode I see that 0 was removed
When working with a single
registryId
:I get
Invalid parameter at 'registryIds' failed to satisfy constraint: 'Member must satisfy constraint: [Member must satisfy regular expression pattern: [0-9]{12}]'
. Yes, theregistryId
is twelve numeric digits.When I remove the entry and rely on the default registry, it works.