Fix duplicate GitHub App token step in safe-outputs job#16135
Conversation
- Remove duplicate addition of app token minting step (lines 39-44) - Fix insertion logic to position token step BEFORE shared checkout steps - Add regression test TestGitHubAppWithPushToPRBranch - Fixes compilation error when app and push-to-pull-request-branch are both configured Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main and recompile |
…-safe-outputs # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
Merged main branch (commits 5878d89, a0065c6) and recompiled all workflows. All 154 workflows compiled successfully. Merge commit: d5eb066 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a compiler bug where the GitHub App token minting step was duplicated when both app and push-to-pull-request-branch were configured in safe-outputs, causing compilation to fail with "duplicate step 'Generate GitHub App token' found in job 'safe_outputs'".
Changes:
- Removed duplicate GitHub App token step addition at the beginning of the function
- Updated comments to clarify the insertion logic and ordering constraints
- Added comprehensive regression test to prevent future duplication
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pkg/workflow/compiler_safe_outputs_job.go |
Removed duplicate app token step addition (lines 39-44 replaced with comment); updated comment at line 242 to clarify insertion happens before checkout steps |
pkg/workflow/compiler_safe_outputs_job_test.go |
Added TestGitHubAppWithPushToPRBranch regression test that validates token step appears exactly once and in correct order |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix duplicate GitHub App token step in safe-outputs job
Root Cause
The bug was in
pkg/workflow/compiler_safe_outputs_job.go:Fix Applied
TestGitHubAppWithPushToPRBranchTesting
TestGitHubAppWithPushToPRBranch)Changes
Modified files:
pkg/workflow/compiler_safe_outputs_job.go: Remove duplicate app token step additionpkg/workflow/compiler_safe_outputs_job_test.go: Add regression testKey insight: GitHub App token step must be inserted AFTER setup/artifact downloads but BEFORE shared checkout steps, as checkout steps reference
steps.safe-outputs-app-token.outputs.tokenOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.