CI: only main's newest commit moves latest-main
Pull request / title (pull_request) Successful in 1s
CI / test (pull_request) Successful in 1m33s
CI / image (apps/api/Dockerfile, t5de-hub-api) (pull_request) Skipped
CI / image (apps/web/Dockerfile, t5de-hub-web) (pull_request) Skipped

This commit is contained in:
dhkatz committed 2026-11-19 02:15:16 -08:00
1 parent df42b7833a
commit 8458149103
1 file changed
+5 -1
+5 -1
View File
@@ -55,7 +55,11 @@ jobs:
DOCKERFILE: ${{ matrix.dockerfile }}
run: |
case "$GITHUB_REF" in
refs/heads/main) version="main-${GITHUB_SHA::12}"; tags="latest-main $version" ;;
refs/heads/main)
version="main-${GITHUB_SHA::12}"; tags="$version"
# Merges close together can finish out of order: only main's newest commit moves latest-main (staging).
if [ "$(git ls-remote origin refs/heads/main | cut -f1)" = "$GITHUB_SHA" ]; then tags="latest-main $tags"
else echo "main has moved on since this commit: :$version only, latest-main stays"; fi ;;
refs/tags/v*)
version="${GITHUB_REF#refs/tags/v}"
[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "Not a vX.Y.Z tag: no image"; exit 0; }