Handle GitHub Actions PR creation permission errors with auto-filed issues#11410
Handle GitHub Actions PR creation permission errors with auto-filed issues#11410
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Modified create_pull_request.cjs to detect "GitHub Actions is not permitted to create or approve pull requests" error - Set error_message output variable when permission error occurs - Added error_message output to create_pull_request job definition - Added conclusion job step to handle permission errors and create tracking issue - Issue includes instructions and documentation link for enabling PR creation permission Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Changed from file-based script to inline script in notify_comment.go - Script is now properly embedded in the conclusion job step - All unit tests related to my changes pass - Note: Unrelated TestCodexEngineRenderMCPConfig failure exists in main Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot move JavaScript to file in actions/setup/js , update setup.sh |
- Created handle_create_pr_error.cjs in actions/setup/js/ - Updated notify_comment.go to use require() instead of inline script - Script is automatically copied by setup.sh to /opt/gh-aw/actions/ - Follows same pattern as other handlers like handle_agent_failure.cjs Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Recompile with @copilot. |
- All workflows with create-pull-request now use handle_create_pr_error.cjs - Changed from inline script to require() pattern across all workflows - 24 workflow lock files updated with the new handler Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
PR titles reviewed: Add discussion commenting to smoke workflows with explicit instructions, deprecate discussion flag
|
|
🎮 GAME OVER? Not quite! The Copilot smoke test agent just popped in to say hi! 👾 We're testing all the things - GitHub MCP, Serena, Playwright, file I/O, bash tools, and of course... visiting your excellent Firewall Escape report! Your sandbox security work is chef's kiss 🤌 - 40 techniques, 100% novelty, zero escapes. That's some serious defense-in-depth action right there! Keep up the amazing security testing! 🛡️✨ Beep boop 🤖 - Smoke test agent signing off!
|
Smoke Test: Copilot - PASS ✅Recent PRs tested:
Test Results:
Overall Status: PASS ✅ cc @pelikhan
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
Smoke Test Results - Claude EngineOverall Status: ✅ PASS
PRs Retrieved:
Run: §21271981674
|
Plan: Add error handling for "GitHub actions is not permitted to create or approve pull requests"
Changes Completed
create_pull_request.cjsto detect the specific permission errorerror_messageoutput variable when this error occursFiles Modified
/home/runner/work/gh-aw/gh-aw/actions/setup/js/create_pull_request.cjs- Added error detection and output/home/runner/work/gh-aw/gh-aw/actions/setup/js/handle_create_pr_error.cjs- NEW: Error handler script (automatically copied by setup.sh)/home/runner/work/gh-aw/gh-aw/pkg/workflow/create_pull_request.go- Added error_message output/home/runner/work/gh-aw/gh-aw/pkg/workflow/notify_comment.go- Updated to use require() pattern.lock.ymlfiles - Recompiled to use new handlerImplementation Details
When create_pull_request fails with permission error:
core.setOutput("error_message", ...)with helpful message and documentation link${{ needs.create_pull_request.outputs.error_message }}handle_create_pr_error.cjsusing require() pattern (like other handlers)Note on setup.sh
The
setup.shscript inactions/setup/automatically copies all.cjsfiles fromactions/setup/js/to/opt/gh-aw/actions/at runtime, so no changes to setup.sh were needed.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Changeset
error_messageoutput and adding an auto-filed issue handler with guidance and docs links when Actions cannot create or approve pull requests in the repository.