generated from actions/container-action
-
Notifications
You must be signed in to change notification settings - Fork 11
28 lines (24 loc) · 1.08 KB
/
check_docker_latest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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. ')