From 402ac9e3954103dc9a6660aea4cfa1eb8342ba1d Mon Sep 17 00:00:00 2001 From: FinnIckler Date: Mon, 23 Sep 2024 14:20:23 +0200 Subject: [PATCH] fix Build tag not being set correctly for deployments from prs (#684) --- .github/workflows/pr.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 1279a526..c2c67e86 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -29,6 +29,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.issue.number }} + - name: Get the SHA of the current branch/fork + shell: bash + run: | + echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV" if: steps.trigger-deployment.outputs.triggered == 'true' - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -56,7 +60,7 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max build-args: | - BUILD_TAG=${{ github.sha }} + BUILD_TAG=${{ env.SHORT_SHA }} - name: Build and push worker Image if: steps.trigger-deployment.outputs.triggered == 'true' uses: docker/build-push-action@v6 @@ -69,7 +73,7 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max build-args: | - BUILD_TAG=${{ github.sha }} + BUILD_TAG=${{ env.SHORT_SHA }} - name: Deploy if triggered if: steps.trigger-deployment.outputs.triggered == 'true' env: