Skip to content

fix(ci): grant the bump workflow the write permissions it now needs - #45

Merged
Piccirello merged 1 commit into
masterfrom
fix/grant-bump-workflow-write-permissions
Aug 5, 2026
Merged

Piccirello merged 1 commit into
masterfrom
fix/grant-bump-workflow-write-permissions

Conversation

@Piccirello

Copy link
Copy Markdown
Member

Summary

Follow-up to #44. That PR dropped secrets.POSTHOG_BOT_PAT (a secret that does not exist on this repo, so both the checkout and the PR step were running with an empty token) and switched to GITHUB_TOKEN, which is required for sign-commits to work — signing only happens with a bot-generated token, never a PAT.

What it missed: this repo's default workflow permission is read, and the workflow declares no permissions: block. With the PAT gone, GITHUB_TOKEN has no write access, so the next bump patch|minor|major merge would fail with a 403 when create-pull-request tries to push the branch and open the PR.

Changes

  • Add a workflow-level permissions: block granting contents: write and pull-requests: write

Testing

Not run end to end — the workflow only fires when a PR carrying a bump * label is merged, and it has only ever been skipped in recent history. Confirmed via repos/PostHog/drf-exceptions-hog/actions/permissions/workflow that default_workflow_permissions is read, and that no permissions: key exists anywhere in the workflow.

Two pre-existing problems this does not fix

Flagging rather than fixing, since both are out of scope and predate #44:

  • The job targets ubuntu-20.04, a runner GitHub has retired, so it cannot start at all. Whoever owns this repo should bump it.
  • A PR opened with GITHUB_TOKEN does not trigger on: pull_request workflows, so CI.yml will not run on the bump PR. release.yml still fires, because a human performs the merge. A GitHub App token would both sign and trigger CI, if that matters enough to set one up.

Dropping the (nonexistent) PAT left GITHUB_TOKEN read-only, since the repo
default is read and the workflow declares no permissions block. The next
labelled merge would 403 when opening the bump PR.
@Piccirello
Piccirello merged commit 03cec14 into master Aug 5, 2026
9 of 23 checks passed
@Piccirello
Piccirello deleted the fix/grant-bump-workflow-write-permissions branch August 5, 2026 04:41
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