Skip to content

fix: tag the released ref, and record image provenance in the release - #55

Merged
cshuttle merged 1 commit into
mainfrom
fix/tag-the-ref-record-provenance
Aug 4, 2026
Merged

fix: tag the released ref, and record image provenance in the release#55
cshuttle merged 1 commit into
mainfrom
fix/tag-the-ref-record-provenance

Conversation

@cshuttle

@cshuttle cshuttle commented Aug 4, 2026

Copy link
Copy Markdown
Owner

My v1.4.0 fix was wrong, and the retry proved it. I claimed the git-data API avoids GitHub's workflow-file protection. It does not — creating a ref at a commit whose .github/workflows differ from the default branch fails over the API just as it does over git push, reported less helpfully as:

HttpError: Resource not accessible by integration — /rest/git/refs#create-a-reference

The constraint is the token, not the transport, and GITHUB_TOKEN cannot hold the workflow scope by any route.

Why this is routine, not exotic

The tag has landed on each image's build commit since v1.1.1. Any CI change merged after the last image build makes that commit's workflows differ from main — and that is precisely the moment someone reaches for a release. VirtualWindow hit it on both attempts: its build commit predates both a ggshield pin and the release workflow itself.

Verified rather than assumed:

git diff --stat 4749ed9 origin/main -- .github/workflows/
 .github/workflows/ggshield.yml |  2 +-
 .github/workflows/release.yml  | 56 ++++++++++++++

The change

Stop encoding provenance in where the tag points. The tag marks the release point on the ref being released — whose workflows are the default branch's by definition, so the restriction can never apply. Provenance moves into content: the tag message and the release body now name the build commit of every image, e.g.

  • ghcr.io/cshuttle/virtualwindow:v1.1.0sha256:…, built from 4749ed9

"Which commit is this version?" stays answerable, from the release instead of the ref. The guard is untouched — each image is still proven to come from this branch's history.

The alternative I rejected

A classic PAT with workflow scope in every releasing repo. That trades a readable tag target for a long-lived credential in eight repos, in an estate already working to retire the one it has.

v1.4.0 claimed the git-data API sidesteps GitHub's workflow-file protection. It
does not. Creating a ref at a commit whose .github/workflows differ from the
default branch fails the same way over the API as over git push, reported as
"Resource not accessible by integration" — the constraint is the token, not the
transport, and GITHUB_TOKEN cannot hold the `workflow` scope.

That condition is routine, not exotic: any CI change after the last image build
triggers it, which is exactly when a release tends to happen. VirtualWindow hit
it on both attempts (its build commit predates a ggshield pin and the release
workflow itself).

So stop encoding provenance in where the tag points. The tag marks the release
point on the ref; the tag message and the release body name the build commit of
every image. "Which commit is this version?" is still answerable — from the
release rather than from the ref — and no repo needs a long-lived PAT to cut one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cshuttle
cshuttle merged commit 8421ec0 into main Aug 4, 2026
7 checks passed
@cshuttle
cshuttle deleted the fix/tag-the-ref-record-provenance branch August 4, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant