fix: replace gh-ecr-push action for aws-cli-v2 #1871
Merged
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.
Problem
What problem are you trying to solve? What issue does this close?
Our Github action workflow opengovsg/gh-ecr-push@v1 no longer works on Github's Ubuntu 18 virtual machines as the virtual machines have updated their AWS CLI installation to AWS CLI v2. As a result, the command
aws ecr get-login
(line 26) is deprecated, causing our CI/CD runs to break.Solution
How did you solve the problem?
Initially, we considered 1) pulling the newest version from the original upstream or 2) updating our OGP fork specifically to be compatible with AWS CLI v2.
However, following FormSg and Redeem's new patterns, I've instead swapped the workflow out to use the official AWS Actions,
aws-actions/configure-aws-credentials@v1
andaws-actions/amazon-ecr-login@v1
for logging in, and to run the Docker build, tag and push commands separately.Tests
What tests should be run to confirm functionality?
edge