diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 0d7bfb9..8e3b446 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -154,15 +154,25 @@ jobs: - name: Generate image tags and version id: tags + # POSIX `case` instead of bash `[[ ]]` because act_runner invokes + # `sh -e` (dash on the ci-python:3.14 image, which has no bash on + # the default PATH for /bin/sh). Previous `[[ ]]` form failed + # silently — only the SHA tag got appended, so :dev / :latest + # never updated in the registry and the deployed stack kept + # pulling stale images. Verified via `[[: not found` lines in + # the runner log on commit 2a374d9. run: | TAGS="${{ env.IMAGE }}:${{ github.sha }}" BUILD_VERSION="dev" - if [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then - TAGS="$TAGS,${{ env.IMAGE }}:dev" - elif [[ "${{ github.ref }}" == refs/tags/* ]]; then - TAGS="$TAGS,${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ github.ref_name }}" - BUILD_VERSION="${{ github.ref_name }}" - fi + case "${{ github.ref }}" in + refs/heads/dev) + TAGS="$TAGS,${{ env.IMAGE }}:dev" + ;; + refs/tags/*) + TAGS="$TAGS,${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ github.ref_name }}" + BUILD_VERSION="${{ github.ref_name }}" + ;; + esac echo "value=$TAGS" >> $GITHUB_OUTPUT echo "build_version=$BUILD_VERSION" >> $GITHUB_OUTPUT