From a73b2f6dd142cabc2c0c4ca42ec016234d91e094 Mon Sep 17 00:00:00 2001 From: Adam Kamali Date: Thu, 26 Nov 2026 09:35:29 +0000 Subject: [PATCH] CI: tag pull request image builds pr- On a pull request github.ref_name is '/merge', which is not a valid image tag, so the docker build step failed on every PR after the site itself had built. The PR build (never pushed) is now tagged pr-; pushes to main and dev keep the branch name. Agent: claude Co-Authored-By: Claude Fable 5.2 --- .github/workflows/image.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 2cfb66d..b9ff901 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -23,12 +23,14 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + # On a pull request github.ref_name is "/merge", which is not a + # valid image tag: the build is tagged pr- there (never pushed). - uses: docker/build-push-action@v6 with: context: . push: ${{ github.event_name == 'push' }} tags: | - ghcr.io/stackblaze/stackblaze-docs:${{ github.ref_name }} + ghcr.io/stackblaze/stackblaze-docs:${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || github.ref_name }} ghcr.io/stackblaze/stackblaze-docs:sha-${{ github.sha }} cache-from: type=gha cache-to: type=gha,mode=max