Repository navigation
ci: configure ECR authentication with dedicated role variables - #469
Merged
Merged
Conversation
Merged
cdalvaro
approved these changes
Oct 23, 2026
nataliafit
marked this pull request as ready for review
October 23, 2026 14:10
cdalvaro
enabled auto-merge (rebase)
October 23, 2026 14:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A little less anonymous pulling, a lot less wrestling with ECR limits! 🙂 I've added ECR Public login to the image build, the test runners, and the security-analysis job, with a dedicated read-only OIDC role rather than borrowing the publishing role.
Each job gets its own login—including the runners that build images inside the salt-ssh tests. Fork and Dependabot PRs keep using anonymous public pulls and never attempt to assume the AWS role.
I've also moved the publishing role ARN out of the workflow and into its own repository variable. Same publishing role and permissions, just a cleaner place for its identifier. The read-only and publishing roles stay separate. 🙂
A small stdlib-only regression check runs in the build workflow's metadata job to keep the CI login guards, ordering, and repository-variable lookup covered.
Configuration
Both ARNs come from repository Actions variables, not secrets:
AWS_ECR_READ_ONLY_ROLE_ARN: build, tests, and security analysis use${{ vars.AWS_ECR_READ_ONLY_ROLE_ARN }}.AWS_ECR_PUBLISH_ROLE_ARN: publication uses${{ vars.AWS_ECR_PUBLISH_ROLE_ARN }}instead of its previous hardcoded ARN.They're resource identifiers, not credentials; GitHub obtains the actual short-lived AWS credentials through OIDC. Both variables are configured, and the publishing variable matches the previous publishing role exactly. This change does not alter IAM policies or publishing triggers.
The read-only role needs only these permissions for authenticated public pulls—no push permissions:
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["ecr-public:GetAuthorizationToken", "sts:GetServiceBearerToken"], "Resource": "*" }] }Its OIDC trust must match this repository's pull-request context and its
mainbranch context for scheduled security runs, with audiencests.amazonaws.com. Authentication usesus-east-1, as required for ECR Public.