Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update the compiler to pass the safe output "staged" environment variable to the job that runs create-pull-request
Add staged environment variable support to create-pull-request job
Sep 12, 2025
Collaborator
|
@copilot review and fix "as-labels" and "create-issue" for the same issue |
…-label jobs Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
I've reviewed and fixed both "as-labels" (add-issue-label) and "create-issue" for the same issue. Added staged environment variable support to both 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:
|
Copilot
AI
changed the title
Add staged environment variable support to create-pull-request job
Add staged environment variable support to create-pull-request, create-issue, and add-issue-label jobs
Sep 12, 2025
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.
The compiler now passes the
GITHUB_AW_SAFE_OUTPUTS_STAGEDenvironment variable to the create-pull-request, create-issue, and add-issue-label jobs when thestagedflag is set to true in the safe-outputs configuration.Problem
When workflows are configured with
staged: truein their safe-outputs configuration, the staged environment variable was not being passed to the create-pull-request, create-issue, and add-issue-label jobs. This meant that these jobs couldn't operate in staged/preview mode, preventing users from seeing what pull requests, issues, or labels would be created without actually creating them.Solution
Updated the
buildCreateOutputPullRequestJob,buildCreateOutputIssueJob, andbuildCreateOutputLabelJobfunctions inpkg/workflow/compiler.goandpkg/workflow/output_labels.goto include theGITHUB_AW_SAFE_OUTPUTS_STAGEDenvironment variable whendata.SafeOutputs.Stagedis not nil and is true. The implementation follows the same pattern used in the AI engines (Claude, Codex, Custom) for consistency.Changes
pkg/workflow/compiler.go: Added staged environment variable logic to the create-pull-request and create-issue jobspkg/workflow/output_labels.go: Added staged environment variable logic to the add-issue-label jobpkg/workflow/staged_pull_request_test.go,pkg/workflow/staged_create_issue_test.go, andpkg/workflow/staged_add_issue_labels_test.goto verify correct behavior for all scenarios (staged=true, staged=false, staged=nil)Testing
All existing tests pass, and new tests specifically verify that:
staged: truestaged: falseor unspecifiedThis ensures workflows using staged mode will now properly preview pull request creation, issue creation, and label addition without actually performing these actions.
Warning
api.contoso.com/tmp/go-build1940014964/b278/cli.test -test.testlogfile=/tmp/go-build1940014964/b278/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.