Skip to content

fix(ci): use PAT in release.yml so release.published fires downstream - #148

Merged
laradji merged 1 commit into
mainfrom
code/feat-fixci-pat-releaseyml-3sp
Apr 27, 2026
Merged

laradji merged 1 commit into
mainfrom
code/feat-fixci-pat-releaseyml-3sp

Conversation

@laradji

@laradji laradji commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Substitutes GH_TOKEN on release.yml's Create GitHub release step from the default GITHUB_TOKEN to a fine-grained PAT (RELEASE_PUBLISH_TOKEN, scope laradji/deadzone only, Contents: Read and write).
  • Restores the release.published → update-package-channels.yml chain that GitHub's anti-recursion rule blocks when the publish event is emitted by the default token.
  • Build matrix and other workflow steps untouched — least privilege.

Why

GitHub's documented behaviour: events triggered by the default GITHUB_TOKEN do not spawn new workflow runs. v0.2.0 (2026-04-17) confirmed this in production — the tap bump never auto-fired and had to be triggered manually via the workflow_dispatch escape hatch added in 1edd01d. That escape hatch stays as the manual fallback (out of scope for this change, per #130).

Operator action required before this is effective

  • PAT exists and has been added to repo secrets as RELEASE_PUBLISH_TOKEN (scope: this repo only, Contents: Read and write, no other permissions).
  • Post-merge probe: scratch tag v0.0.0-token-probe → confirm update-package-channels.yml fires automatically → cleanup release + tag.

Test plan

Closes #130

The default GITHUB_TOKEN is anti-recursion-gated, so the release.published
event it emits never spawned update-package-channels.yml — leaving every
v0.x.0 tap bump to a manual `gh workflow run` (escape hatch from 1edd01d).
Substitute GH_TOKEN on the publish step only with a fine-grained
RELEASE_PUBLISH_TOKEN PAT scoped to this repo (Contents: write).

Build matrix is intentionally untouched — least privilege.

Closes #130
@laradji
laradji merged commit 9f7239e into main Apr 27, 2026
4 checks passed
@laradji
laradji deleted the code/feat-fixci-pat-releaseyml-3sp branch April 27, 2026 21:16
laradji pushed a commit that referenced this pull request May 7, 2026
…dispatch

The default GITHUB_TOKEN is allowed to call workflow_dispatch, but the
resulting run's completion does not spawn workflow_run downstreams
(anti-recursion gate). scrape-pack ran fine on the v0.7.2 tag push
but chain-image never fired; a manual probe with a real user PAT did
fire chain-image. Same failure mode #148 fixed for release.yml ->
update-package-channels.yml.

- Rewrite header comment to describe the gate accurately.
- Add Validate secrets step mirroring release.yml's PAT check.
- Switch GH_TOKEN on the dispatch step to CHAIN_DISPATCH_TOKEN.

Closes #216.
laradji added a commit that referenced this pull request May 7, 2026
…dispatch (#217)

The default GITHUB_TOKEN is allowed to call workflow_dispatch, but the
resulting run's completion does not spawn workflow_run downstreams
(anti-recursion gate). scrape-pack ran fine on the v0.7.2 tag push
but chain-image never fired; a manual probe with a real user PAT did
fire chain-image. Same failure mode #148 fixed for release.yml ->
update-package-channels.yml.

- Rewrite header comment to describe the gate accurately.
- Add Validate secrets step mirroring release.yml's PAT check.
- Switch GH_TOKEN on the dispatch step to CHAIN_DISPATCH_TOKEN.

Closes #216.

Co-authored-by: Nacer Laradji <nacer.laradji@gmail.com>
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.

fix(ci): use PAT in release.yml so release.published fires downstream workflows

1 participant