Migrate versioning workflow from PAT to GitHub App token#640
Migrate versioning workflow from PAT to GitHub App token#640
Conversation
Fixes #638. The versioning workflow used a PAT (POLICYENGINE_GITHUB) to push the "Update package version" commit, which broke when the token expired. Switch to a GitHub App token via actions/create-github-app-token@v1, matching the pattern used in policyengine-api-v2-alpha. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Claude aggressively posted this comment on my behalf:
One thing I initially flagged: the `EndBug/add-and-commit@v9` step doesn't explicitly receive the app token — so I worried it might fall back to the default `GITHUB_TOKEN` for the push, which wouldn't trigger downstream workflows (like PyPI publish via `code_changes.yaml`).
After digging in, this is not a concern. Here's why:
- `actions/checkout@v4` with `token: <app-token>` persists that token into the local git config via an `http.extraheader` credential (this is the default `persist-credentials: true` behavior).
- `EndBug/add-and-commit@v9` just shells out to `git push` — it uses whatever credentials the local repo already has configured. Its `github_token` input is only used for GitHub API calls (fetching user info for commit metadata), not for git operations.
- Their README confirms: *"When pushing, the action uses the token that the local git repository has been configured with."*
So the version-bump commit will be pushed with the GitHub App token, which will correctly trigger subsequent workflow runs. LGTM.
So an LGTM is coming and I'll try to get this in before I go to sleep tonight.
baogorek
left a comment
There was a problem hiding this comment.
Left a note about Claude's anxiousness about a token carrying over, but an LGTM from the human.
|
There are other workflow files like reusable_tests.yaml that use similar tokens like (Eg, the test suite was also responsible for publishing datasets, but now the pipeline run also does that, we might want to decide on a single responsible step -- we are overwriting them anyway otherwise). What do you think @baogorek @anth-volk ? |
Fixes #638
Summary
POLICYENGINE_GITHUB) with a GitHub App token in the versioning workflowactions/create-github-app-token@v1withAPP_IDandAPP_PRIVATE_KEYsecrets (already configured in the repo)policyengine-api-v2-alphaTest plan
code_changes.yamland the PyPI publish step runs🤖 Generated with Claude Code