Skip to content

ci(release): use app token for release PR updates#896

Merged
bokelley merged 1 commit into
mainfrom
fix/release-please-app-token
May 28, 2026
Merged

ci(release): use app token for release PR updates#896
bokelley merged 1 commit into
mainfrom
fix/release-please-app-token

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Summary\n- mint an IPR GitHub App installation token in the Release Please workflow\n- pass that token to release-please-action so release PR branch updates trigger downstream protected checks\n- use the same token for the pyproject prerelease normalization checkout/push\n\n## Why\nRelease Please was using the default GITHUB_TOKEN. Branches updated with GITHUB_TOKEN do not trigger pull_request CI/IPR workflows, so generated release PRs could be green for CodeQL/GitGuardian but blocked waiting for required CI contexts that never ran.\n\n## Validation\n- uv run --extra dev --group dev pre-commit run --files .github/workflows/release-please.yml

Copy link
Copy Markdown
Contributor

@aao-ipr-bot aao-ipr-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Right diagnosis, right fix: GITHUB_TOKEN-authored pushes don't trigger downstream pull_request workflows, so release-please PRs were sitting blocked on required contexts that never started. Threading an App installation token through both the action and the pre-normalize checkout is the documented escape hatch.

Things I checked

  • Token flows through both the release-please-action step (release-please.yml:26) and the pre-normalize actions/checkout@v6 (release-please.yml:34) — the two paths that actually push to the release PR branch.
  • Second checkout for the PyPI publish path (release-please.yml:71) intentionally uses the default token. Fine — it only reads, never pushes.
  • Workflow-level permissions: block (release-please.yml:14-16) is unchanged and still correct; the App's own installation permissions are what governs the release-please push now.
  • Commit message uses ci(release): — no semver impact, matches conventional-commits.
  • src/ and tests are untouched; no public API surface to audit.

Follow-ups (non-blocking — file as issues)

  • Verified-bot commit email format. release-please.yml:75-76 sets aao-ipr-bot[bot]@users.noreply.github.com. For the commit to verify against the App's identity, the noreply form needs the numeric-ID prefix: <APP_USER_ID>+aao-ipr-bot[bot]@users.noreply.github.com (mirrors the previous 41898282+github-actions[bot]@… shape). Without the prefix, normalize commits will show as unverified. The numeric ID is on GET /users/aao-ipr-bot%5Bbot%5D.
  • Undocumented IPR_APP_ID / IPR_APP_PRIVATE_KEY for forks. RELEASING.md and PYPI_SETUP.md only mention PYPY_API_TOKEN. A fork that copies this workflow will hit an opaque create-github-app-token failure at the Mint App token step. Either add an App-setup section to RELEASING.md or fall back to GITHUB_TOKEN when the secret is empty (if: \${{ secrets.IPR_APP_ID != '' }} on the mint step + conditional token: inputs). Falls under the same documented pattern as ai-review.yml / ipr-agreement.yml.
  • Normalize step gates on prs_created == 'true' (release-please.yml:36). A subsequent push to main that updates an existing release PR will set prs_updated, not prs_created, and the normalization will be skipped. release-please regenerates pyproject.toml on updates, so the unnormalized version can land on the PR until the next created-cycle. Consider widening the gate to also cover prs_updated.
  • Branch-protection allowlists. Identity flip from github-actions[bot] to aao-ipr-bot[bot] will fail-closed if any "Restrict who can push" list on main or the release branch still names only the old identity. Can't verify from the tree — confirm in repo settings before this merges into production traffic.

Minor nits (non-blocking)

  1. Unused mint on publish-only dispatch. Mint App token (release-please.yml:25) runs unconditionally, but the next step is gated by if: github.event_name != 'workflow_dispatch' || inputs.publish != true. On a publish-only workflow_dispatch, the token is issued and never used. Mirror the same if: on the mint step if you want to skip the wasted issuance.

Approving on the strength of the token threading and the unchanged publish path. Verified-commit email is the one that's worth a quick follow-up.

@bokelley bokelley merged commit 62fa7ff into main May 28, 2026
26 checks passed
@bokelley bokelley deleted the fix/release-please-app-token branch May 28, 2026 12:04
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