generated from actions/container-action
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check that Docker latest tag is correct
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. ') |