Update ECR repository creation to enable image scanning on push
This commit is contained in:
parent
846a7e68a6
commit
d2e3642a54
|
|
@ -29,12 +29,14 @@ jobs:
|
||||||
- name: Login to Amazon ECR
|
- name: Login to Amazon ECR
|
||||||
id: login-ecr
|
id: login-ecr
|
||||||
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
|
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
|
||||||
|
- name: Create ECR repository (if it does not exist)
|
||||||
|
run: |
|
||||||
aws ecr create-repository \
|
aws ecr create-repository \
|
||||||
--repository-name "${ECR_REPOSITORY}" \
|
--repository-name "${ECR_REPOSITORY}" \
|
||||||
--image-scanning-configuration scanOnPush=true \
|
--image-scanning-configuration scanOnPush=false \
|
||||||
>/dev/null 2>&1 || aws ecr describe-repositories --repository-names "${ECR_REPOSITORY}" >/dev/null
|
>/dev/null 2>&1 || aws ecr describe-repositories --repository-names "${ECR_REPOSITORY}" >/dev/null
|
||||||
|
|
||||||
|
|
||||||
- name: Enforce image tag immutability
|
- name: Enforce image tag immutability
|
||||||
run: |
|
run: |
|
||||||
aws ecr put-image-tag-mutability \
|
aws ecr put-image-tag-mutability \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue