Skip to content

Commit

Permalink
fix: wrong region passed
Browse files Browse the repository at this point in the history
Some 'aws' commands have region passed via the 'AWS_DEFAULT_REGION'
flag. This flag is overridable via the 'AWS_REGION' flag which has a
higher priority. We can instead pass the region as explicit flags which
will block it from being overridden.
  • Loading branch information
PrashantRaj18198 committed Aug 1, 2022
1 parent 77b30d7 commit 78912d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function set_ecr_repo_policy() {
if [ "${1}" = true ]; then
echo "== START SET REPO POLICY"
if [ -f "${INPUT_REPO_POLICY_FILE}" ]; then
aws ecr set-repository-policy --repository-name $INPUT_REPO --policy-text file://"${INPUT_REPO_POLICY_FILE}"
aws ecr set-repository-policy --region $AWS_DEFAULT_REGION --repository-name $INPUT_REPO --policy-text file://"${INPUT_REPO_POLICY_FILE}"
echo "== FINISHED SET REPO POLICY"
else
echo "== REPO POLICY FILE (${INPUT_REPO_POLICY_FILE}) DOESN'T EXIST. SKIPPING.."
Expand All @@ -115,7 +115,7 @@ function put_image_scanning_configuration() {
if [ "${1}" = true ]; then
echo "== START SET IMAGE SCANNING CONFIGURATION"
if [ "${INPUT_IMAGE_SCANNING_CONFIGURATION}" = true ]; then
aws ecr put-image-scanning-configuration --repository-name $INPUT_REPO --image-scanning-configuration scanOnPush=${INPUT_IMAGE_SCANNING_CONFIGURATION}
aws ecr put-image-scanning-configuration --region $AWS_DEFAULT_REGION --repository-name $INPUT_REPO --image-scanning-configuration scanOnPush=${INPUT_IMAGE_SCANNING_CONFIGURATION}
echo "== FINISHED SET IMAGE SCANNING CONFIGURATION"
fi
fi
Expand Down

0 comments on commit 78912d8

Please sign in to comment.