From c8a97af7377d3727a97e6645b2775cc7c8bc6e35 Mon Sep 17 00:00:00 2001 From: you Date: Sun, 5 Apr 2026 22:12:37 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20Docker=20publish=20workflow=20=E2=80=94?= =?UTF-8?q?=20BUILD=5FTIME=20and=20APP=5FVERSION=20build=20args?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUILD_TIME was passed as a literal $(date ...) string in the with: block, which is not evaluated as a shell command. Moved to a preceding step that writes to GITHUB_OUTPUT. APP_VERSION used github.ref_name which resolves to 'master' on push events. Now uses the tag name for tag pushes, or the commit SHA otherwise. --- .github/workflows/publish.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index dc80e0b2..46c4c17e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -39,6 +39,19 @@ jobs: # On master push: edge type=edge,branch=master + - name: Set build time + id: buildtime + run: echo "value=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> "$GITHUB_OUTPUT" + + - name: Compute app version + id: appversion + run: | + if [[ "${{ github.ref }}" == refs/tags/v* ]]; then + echo "value=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" + else + echo "value=${{ github.sha }}" >> "$GITHUB_OUTPUT" + fi + - uses: docker/build-push-action@v6 with: context: . @@ -47,8 +60,8 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | - APP_VERSION=${{ github.ref_name }} + APP_VERSION=${{ steps.appversion.outputs.value }} GIT_COMMIT=${{ github.sha }} - BUILD_TIME=$(date -u +'%Y-%m-%dT%H:%M:%SZ') + BUILD_TIME=${{ steps.buildtime.outputs.value }} cache-from: type=gha cache-to: type=gha,mode=max