11name : Retag containers after new push / PR
22
3- env :
4- # set this to true in GitHub variables to enable building the container
5- # HAS_CONTAINER: true
6- # Use docker.io for Docker Hub if empty
7- REGISTRY : ghcr.io
8- # github.repository as <account>/<repo>
9- IMAGE_NAME : ${{ github.repository }}
10-
113concurrency :
124 group : " ${{ github.workflow }}" # last one must win
135 cancel-in-progress : false # no we need them
@@ -31,6 +23,15 @@ permissions:
3123 contents : write
3224 packages : write
3325
26+ env :
27+ CARGO_TERM_COLOR : always
28+ # set this to true in GitHub variables to enable building the container
29+ # HAS_CONTAINER: true
30+ # Use docker.io for Docker Hub if empty
31+ REGISTRY : ghcr.io
32+ # github.repository as <account>/<repo>
33+ IMAGE_NAME : ${{ github.repository }}
34+
3435jobs :
3536 repo-has-container :
3637 name : Repo has container?
7677
7778 else
7879 echo "The incoming push isn't a merge, ergo it's not a PR"
80+ exit 1
7981 fi
8082
8183 - name : Download crane tar, extract, and add folder to path.
@@ -152,13 +154,13 @@ jobs:
152154 run : |
153155 # search for the tag, there can only be zero or one match
154156 # we need the || true because otherwise grep returns exit code 1 and github actions then dies
155- pr_tag_found=$(cat existing_tags | grep -c "^${PR_TAG}\$") || true
157+ pr_tag_found=$(cat existing_tags | grep -c "^${{ env. PR_TAG } }\$") || true
156158
157159 if [ $pr_tag_found -eq 1 ]
158160 then
159161 echo "Incoming PR produced a Docker image"
160162
161- echo "OLD_TAG=${PR_TAG}" >> ${GITHUB_ENV}
163+ echo "OLD_TAG=${{ env. PR_TAG } }" >> ${GITHUB_ENV}
162164 echo "SUFFIX=actual" >> ${GITHUB_ENV}
163165 else
164166 # If we don't have an old tag, then the incoming PR didn't produce a container.
0 commit comments