Skip to content

ci: use PAT for release-please to trigger required CI checks#20

Merged
mlorentedev merged 2 commits into
masterfrom
chore/release-please-pat-for-ci-triggers
May 18, 2026
Merged

ci: use PAT for release-please to trigger required CI checks#20
mlorentedev merged 2 commits into
masterfrom
chore/release-please-pat-for-ci-triggers

Conversation

@mlorentedev
Copy link
Copy Markdown
Owner

@mlorentedev mlorentedev commented May 18, 2026

Summary

PRs opened by the default GITHUB_TOKEN do not trigger pull_request workflows — GitHub suppresses these events to prevent infinite recursion when one workflow creates a PR that would trigger another. With branch protection on master requiring test / lint / security status checks, the auto-generated release-please PR ends up in BLOCKED state with no CI ever running.

This is what hit us today on PR #19 (v1.5.1). The previous release PR #15 (v1.5.0) silently dodged the issue because something retriggered CI manually 11 minutes after the PR opened (likely a UI "Update branch" click).

Fix

Pass an explicit PAT to release-please-action via the token: input. PRs created with a PAT appear as user-driven events to GitHub, so the pull_request trigger fires normally.

token: ${{ secrets.RELEASE_PLEASE_PAT || secrets.GITHUB_TOKEN }}

The || fallback to GITHUB_TOKEN means this PR is safe to merge before the secret is configured — the workflow keeps using the legacy behavior until the PAT is added. No disruption.

Setup checklist (one-time, after merging this PR)

  • Generate a fine-grained PAT:
    • Repository access: Only select mlorentedev/ts-bridge
    • Permissions:
      • Contents: Read and write
      • Pull requests: Read and write
      • Workflows: Read and write (only if a release PR ever changes a .github/workflows/* file — uncommon)
    • Expiration: 1 year recommended, with calendar reminder
  • Add it as repo secret RELEASE_PLEASE_PAT (Settings → Secrets and variables → Actions → New repository secret)
  • On the next release PR, verify CI fires automatically (no close+reopen dance)

Alternatives considered (rejected)

Option Why rejected
Switch ci.yml to pull_request_target Exposes base-branch secrets to PR code — unsafe surface for test/lint jobs
Empty commit / close+reopen on each release Manual toil per release; defeats the point of automation
Drop branch protection on master Loses the safety net for human PRs too
Use a dedicated GitHub App Heavier setup; PAT is sufficient for a single-maintainer repo

Test plan

  • go vet ./... clean (no Go changes, just the workflow)
  • CI on this PR runs the standard checks
  • After merge + secret setup, manually run release.yml on master or wait for the next fix:/feat: to verify the next release PR has CI checks attached at creation time

mlorentedev and others added 2 commits May 18, 2026 11:28
PRs opened by GITHUB_TOKEN do not trigger pull_request workflows by
design (GitHub suppresses to prevent infinite loops). With branch
protection requiring test/lint/security status checks on master, the
release PR ends up BLOCKED with no checks ever running.

Configure release-please-action to use RELEASE_PLEASE_PAT when present
so its PRs appear as user-driven events and CI runs normally. Falls
back to GITHUB_TOKEN until the secret is configured, so this change
is safe to merge before the PAT is created.

Setup (manual, one-time):
1. Create a fine-grained PAT scoped to this repo with permissions:
   - contents: read/write
   - pull_requests: read/write
   - workflows: read/write (only needed if release PRs touch workflow
     files, which is rare)
2. Add it as repo secret named RELEASE_PLEASE_PAT.
3. Next release PR will trigger CI automatically.

v1.5.0 (PR #15) merged successfully despite this latent issue because
CI was retriggered manually within 11 minutes of PR creation. v1.5.1
(PR #19) surfaced the bug because no manual retrigger happened.
@mlorentedev mlorentedev merged commit b78cb5d into master May 18, 2026
11 checks passed
@mlorentedev mlorentedev deleted the chore/release-please-pat-for-ci-triggers branch May 18, 2026 17:36
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