Skip to content

fix: create the release tag through the API, not git push - #54

Merged
cshuttle merged 1 commit into
mainfrom
fix/create-tag-via-api
Aug 4, 2026
Merged

fix: create the release tag through the API, not git push#54
cshuttle merged 1 commit into
mainfrom
fix/create-tag-via-api

Conversation

@cshuttle

@cshuttle cshuttle commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Fourth finding from real use, and the first that would have bitten every repo eventually rather than one.

What failed

VirtualWindow's release promoted both images correctly, then died pushing the tag:

! [remote rejected] v1.1.0 -> v1.1.0 (refusing to allow a GitHub App to create or
  update workflow `.github/workflows/ggshield.yml` without `workflows` permission)

The tag lands on the commit the image came from — by design, so a version names code that is actually in it. That commit predates the repo's ggshield pin, so the ref being pushed carries a workflow file that differs from the default branch's, and a token-authenticated push is not allowed to do that.

No permissions change fixes it: workflows is a PAT scope, not something GITHUB_TOKEN can be granted.

Why it looked fine twice

Topology and Atlas escaped by accident — their tagged commits happened to carry workflow files identical to main's at push time. Any repo whose CI changed after its last image build would have hit this, so the two green releases were luck, not evidence.

The fix

Create the tag through the git-data API: a tag object pointing at an existing commit introduces no file changes, so the workflow-file restriction does not apply. Still annotated, same message, same commit.

Also removes the last reason this job needed write access to the checkout.

VirtualWindow's release failed at the tag push:

  ! [remote rejected] v1.1.0 (refusing to allow a GitHub App to create or
    update workflow `.github/workflows/ggshield.yml` without `workflows`
    permission)

The tag lands on the commit the image came from, and a later commit had changed
that repo's ggshield workflow — so the pushed ref carried a workflow file
differing from the default branch, which a token-authenticated push is not
allowed to do. GITHUB_TOKEN cannot hold the `workflows` scope at all, so no
permissions change fixes it.

Topology and Atlas escaped this only by accident: their tagged commits happened
to have workflow files identical to main's. Any repo where CI changed after the
last image build would have hit it.

The git-data API creates a tag object pointing at an existing commit and
introduces no file changes, so the restriction does not apply. Still annotated,
same message.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cshuttle
cshuttle merged commit 537e58c into main Aug 4, 2026
9 of 10 checks passed
@cshuttle
cshuttle deleted the fix/create-tag-via-api branch August 4, 2026 15:56
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