Skip to content

Commit

Permalink
Check that Docker latest tag is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
johnboyes authored Jan 19, 2024
1 parent 2ba18c6 commit 7b90d70
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/check_docker_latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Check newly released Docker image with current semantic version tag is also tagged with latest
on: # yamllint disable-line rule:truthy
push

jobs:

check_latest_tag:
runs-on: ubuntu-22.04
env:
repo: agilepathway/pull-request-label-checker
image_ver: v1.6.13
steps:

- name: Check Docker image for new release is tagged latest
id: check_docker_image_tagged_latest
# yamllint disable rule:line-length
run: |
docker pull ${{env.repo}}:${{ env.image_ver }}
echo "IS_LATEST_TAGGED_CORRECTLY=$(docker image inspect ${{env.repo}}:${{ env.image_ver }} | jq -r '.[] | (.RepoTags) | any( . == "${{env.repo}}:latest") ')" >> "$GITHUB_OUTPUT"
# yamllint enable rule:line-length

- name: Fail if latest is not tagged correctly
if: ${{ steps.check_docker_image_tagged_latest.outputs.IS_LATEST_TAGGED_CORRECTLY == 'false' }}
uses: actions/github-script@v7
with:
script: |
core.setFailed('The newly released Docker image ${{ env.image_ver }} is not tagged latest. ')

0 comments on commit 7b90d70

Please sign in to comment.