From f2bd772a8d77e892fd7ff1a519f1524f91d0a850 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 18 Nov 2026 17:24:17 +0000 Subject: [PATCH] Keep a late pull request run from cancelling the run of main A pull request that was merged before its run started got a run with the ref of the base branch. That run joined the concurrency group of main and cancelled the run of the merge commit (merge of #192), so no image was built for it. The run then failed, because its token could not write the build cache. Pull request runs are now grouped by their number, and a refused write to the cache of GitHub Actions no longer fails the image build. --- .github/workflows/publish.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4165a38d..33b3fd6b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,9 +21,11 @@ on: pull_request: workflow_dispatch: -# A new run on the same ref cancels the run before it. +# A new run on the same ref cancels the run before it. A pull request run is +# grouped by its number, because a run that starts after its pull request was +# merged gets the ref of the base branch and would cancel the run of the merge. concurrency: - group: publish-${{ github.ref }} + group: publish-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true permissions: @@ -196,7 +198,8 @@ jobs: # and which does not count against the cache limit of GitHub Actions. # A pull request writes its own layers to the cache of GitHub Actions, # so its next push reuses them. One cache per image, so the builds do - # not evict each other's layers. + # not evict each other's layers. A cache write that the token refuses + # does not fail the build. # # A plain single-platform manifest, because watchtower compares the # digest to decide whether an image is new. @@ -220,7 +223,7 @@ jobs: cache-to: >- ${{ github.event_name == 'push' && format('type=registry,ref={0}/cache:orchestrator,mode=max', env.IMAGE_BASE) - || 'type=gha,mode=max,scope=orchestrator' }} + || 'type=gha,mode=max,scope=orchestrator,ignore-error=true' }} provenance: false sbom: false @@ -241,7 +244,7 @@ jobs: cache-to: >- ${{ github.event_name == 'push' && format('type=registry,ref={0}/cache:egress-proxy,mode=max', env.IMAGE_BASE) - || 'type=gha,mode=max,scope=egress-proxy' }} + || 'type=gha,mode=max,scope=egress-proxy,ignore-error=true' }} provenance: false sbom: false @@ -264,7 +267,7 @@ jobs: cache-to: >- ${{ github.event_name == 'push' && format('type=registry,ref={0}/cache:box,mode=max', env.IMAGE_BASE) - || 'type=gha,mode=max,scope=box' }} + || 'type=gha,mode=max,scope=box,ignore-error=true' }} provenance: false sbom: false