Replace personal PAT with GITHUB_TOKEN in versioning workflow#1530
Merged
vahid-ahmadi merged 1 commit intomainfrom Mar 17, 2026
Merged
Replace personal PAT with GITHUB_TOKEN in versioning workflow#1530vahid-ahmadi merged 1 commit intomainfrom
vahid-ahmadi merged 1 commit intomainfrom
Conversation
The Versioning job previously required secrets.POLICYENGINE_GITHUB (a personal PAT) to push the version bump commit and re-trigger the Publish job. This broke when the PAT expired. Changes: - Use GITHUB_TOKEN with contents:write for same-repo checkout/push - Restructure Publish as needs:Versioning sequential job instead of relying on a re-triggered push event (GITHUB_TOKEN pushes don't trigger new workflow runs) - Make cross-repo update_api.py conditional on POLICYENGINE_GITHUB secret availability Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
secrets.POLICYENGINE_GITHUB(expired personal PAT) withGITHUB_TOKENfor same-repo checkout and push in the Versioning jobneeds: Versioning) instead of relying on a re-triggered push event, sinceGITHUB_TOKENpushes don't trigger new workflow runsupdate_api.pystep conditional onPOLICYENGINE_GITHUBsecret availability so core versioning + PyPI publish works without any PATContext
The versioning workflow was failing because
secrets.POLICYENGINE_GITHUB(a personal PAT) expired. The old design required the PAT to push a commit that re-triggered the workflow for the Publish job. This redesign eliminates that dependency for same-repo operations.Note: Cross-repo API updates (
update_api.pywhich bumps policyengine-api and policyengine-household-api) still need a token with cross-repo access. Consider creating an org-scoped fine-grained PAT or GitHub App for this.Test plan
GITHUB_TOKENafter mergeCloses the versioning failure from https://github.com/PolicyEngine/policyengine-uk/actions/runs/23208707049
🤖 Generated with Claude Code