Repository navigation
ci(release): push releases with a short-lived GitHub App token - #2041
Conversation
Co-authored-by: Hassieb Pakzad <hassiebp@users.noreply.github.com>
|
@claude review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Claude Code Review
No review was started: this request came from a bot account. Manual reviews can only be requested by someone with write access to this repository. Ask a maintainer to comment @claude review, or have your automation post the comment from a user account with write access.
Tip: disable this comment in your organization's Code Review settings.
|
@claude review |
There was a problem hiding this comment.
I reviewed this PR and didn't find any bugs. It changes the credentials the release workflow uses to push to main and to tags, and .github/ has a CODEOWNERS entry for maintainers, so a maintainer should still review it.
What was reviewed:
- Every step after the change for leftover uses of
GH_ACCESS_TOKENorgh. Only the tag push andgh release createneed auth, and both now get the App token throughGH_TOKEN. gh auth setup-gitin the push step. The git credential helper runs in that same step's environment, so it picks upGH_TOKEN. Checkout still usespersist-credentials: falsewith the read-only default token.- Where the token is minted: after the build, both smoke tests and the version commit, so nothing that runs package code sees a write token. The action is pinned by SHA, and the step order around the PyPI publish is the same as before.
Extended reasoning...
The change touches only .github/workflows/release.yml and CONTRIBUTING.md. It replaces a long-lived personal access token with a GitHub App token scoped to contents: write for the tag push and the GitHub release, and it lowers the workflow's default contents permission to read. The sensitive part is the release credentials and the branch/tag protection bypass, but nothing here touches application code. I deferred because .github/ is owned by the maintainers team in .github/CODEOWNERS and the change alters release credentials. Also, the workflow can't be fully checked until the App, its variable and secret, and the ruleset bypasses exist.
What does this PR do?
Replaces the long-lived
GH_ACCESS_TOKENpersonal access token in the release workflow with a GitHub App installation token that is minted per run and expires after one hour. Same change as langfuse/langfuse-js#1049.GITHUB_TOKENdrops tocontents: read; checkout no longer uses a PAT.permission-contents: writeand is passed only to the tag push andgh release createsteps.protected branchesenvironment).CONTRIBUTING.mdlists the PyPI trusted publisher and release App prerequisites.Stays a draft until the release GitHub App exists, its
RELEASE_APP_CLIENT_IDvariable andRELEASE_APP_PRIVATE_KEYsecret are on theprotected branchesenvironment, and the App is on the bypass lists formainand thev*tag rulesets. Until then, releases can't push tomaineither way, becausemainno longer allows bypassing branch protection.Type of change
Verification
Not run: a release dry run. The workflow has no dry-run mode and needs the App to exist.
Checklist
code_review.md..env.templateif needed.

Confidence Score: 5/5
The code appears safe to merge once the App setup prerequisites acknowledged by hassiebp are complete.Summary
Replaces the release workflow’s long-lived personal token with a short-lived GitHub App token.
hassiebp acknowledges that the App, environment settings, and bypass permissions must exist before this draft is ready.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Checkout with read access] --> B[Build and smoke tests] B --> C[Commit version locally] C --> D[Create GitHub App token] D --> E[Push version commit and tag] E --> F[Publish to PyPI with OIDC] F --> G[Create GitHub release with App token]Reviews (1) · Last reviewed commit: "ci(release): push releases with a short-..." · Reviewed by Greptile