From d059b2c960a9e57e380890727aaf7ade4814ca4f Mon Sep 17 00:00:00 2001 From: "backport-actions-token[bot]" <87506591+backport-actions-token[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:23:27 -0500 Subject: [PATCH] ci: check image tag (#869) (#870) * ci: check image tag * add script Co-authored-by: Denis Mishin --- .github/workflows/release.yaml | 9 +-------- scripts/check-image-tag.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100755 scripts/check-image-tag.sh diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3d12aa70..6690de9c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,14 +18,7 @@ jobs: - name: Check image reference # check that docker image reference is the same as the release tag - run: | - set -e - img=$(yq eval '.spec.template.spec.containers[0].image' config/pomerium/deployment/image.yaml) - tag=${img#pomerium/ingress-controller:} - if [[ "${tag}" != ${{ github.event.release.tag_name }}" ]]; then - echo "Image tag mismatch: ${tag} != ${{ github.event.release.tag_name }}" - exit 1 - fi + run: ./scripts/check-image-tag.sh ${{ github.event.release.tag_name }} - name: Docker meta id: meta diff --git a/scripts/check-image-tag.sh b/scripts/check-image-tag.sh new file mode 100755 index 00000000..e8dbaf64 --- /dev/null +++ b/scripts/check-image-tag.sh @@ -0,0 +1,15 @@ +# checks that image tag matches the argument + +set -e +want=$1 +if [[ -z "${want}" ]]; then + echo "Usage: $0 " + exit 1 +fi + +img=$(yq eval '.spec.template.spec.containers[0].image' config/pomerium/deployment/image.yaml) +tag=${img#pomerium/ingress-controller:} +if [[ "${tag}" != "${want}" ]]; then + echo "Image tag mismatch: ${tag} != ${want}" + exit 1 +fi