Use push_token for git operations to trigger CI on bot PRs#275
Merged
Use push_token for git operations to trigger CI on bot PRs#275
Conversation
…er on bot PRs PRs created with GITHUB_TOKEN don't trigger pull_request workflows (GitHub restriction). The previous workflow_dispatch workaround ran tests but results didn't appear as PR checks. Add an optional push_token input (PAT or GitHub App token) used for git push and PR creation — GitHub sees events from a real user and triggers all pull_request workflows normally. Remove the workflow_dispatch workaround and actions:write permission since they're no longer needed. https://claude.ai/code/session_01PHFVduUenioa8nn4NMCabe
…, document all token types Rename secret to include GITHUB in the name for consistency. Document that push_token accepts personal PATs (classic or fine-grained) and GitHub App installation tokens. https://claude.ai/code/session_01PHFVduUenioa8nn4NMCabe
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
Replace the workflow dispatch approach for triggering CI checks with a token-based solution. When a
push_tokenis provided, use it for git push and PR creation operations so GitHub recognizes events from a real user and automatically triggerspull_requestworkflows.Key Changes
push_tokeninput: Added optional input parameter that accepts a PAT or GitHub App token for git operations. Falls back togithub_tokenif not provided.pull_requestworkflows.workflow_dispatchAPI calls that previously attempted to trigger the test workflow. This approach is no longer needed when using a proper token.actions: writepermission: No longer required since we're not dispatching workflows manually.AUTO_IMPLEMENT_PUSH_TOKENsecret.Implementation Details
push_tokendefaults togithub_tokenif not explicitly set, maintaining backward compatibilitypush_tokenis set, both git operations and PR creation use it, ensuring consistent authenticationGITHUB_TOKENnot triggeringpull_requestworkflows by using a real user token insteadreposcope or fine-grained token withcontents: write+pull-requests: writehttps://claude.ai/code/session_01PHFVduUenioa8nn4NMCabe