Conversation
…clarity - determine_automatic_lockdown.cjs: eliminate duplicate core.setOutput() calls in if/else branches by moving them after the conditional, using the already-computed resolvedMinIntegrity/resolvedRepos variables - pr_review_buffer.cjs: simplify shouldAddFooter initialization — derive directly from footerMode === 'always' and remove the redundant shouldAddFooter = false branch for 'none' - mcp_environment.go: clarify the second 'Check for safe-outputs env vars' comment that was identical to the one above; this block adds server connection details (port/API key), not the GH_AW_SAFE_OUTPUTS passthrough Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pelikhan
approved these changes
Mar 20, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR performs small refactors to simplify control flow and reduce duplication while keeping behavior unchanged across guard-policy output computation, PR review footer logic, and safe-outputs environment variable comments.
Changes:
- Deduplicates
core.setOutput()calls in automatic guard policy resolution by computing resolved values once and emitting outputs after branch-specific logging. - Simplifies
shouldAddFooterinitialization in PR review submission logic by deriving the default fromfooterMode === "always". - Clarifies a misleading duplicated comment in MCP environment variable collection related to safe-outputs server connection variables.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| actions/setup/js/determine_automatic_lockdown.cjs | Moves repeated setOutput calls outside conditionals while preserving resolved values and logging. |
| actions/setup/js/pr_review_buffer.cjs | Simplifies footer inclusion boolean initialization without changing supported modes. |
| pkg/workflow/mcp_environment.go | Updates comment text to accurately describe the safe-outputs server env vars being added. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This PR simplifies recently modified code (2026-03-20) to improve clarity and reduce duplication while preserving all functionality.
Files Simplified
actions/setup/js/determine_automatic_lockdown.cjs— eliminate duplicatecore.setOutput()callsactions/setup/js/pr_review_buffer.cjs— simplifyshouldAddFooterinitialization logicpkg/workflow/mcp_environment.go— clarify misleading duplicate commentImprovements Made
1. Reduced Code Duplication (
determine_automatic_lockdown.cjs)The
setOutput()call was duplicated in both branches of anif/else(once for the "not configured" case, once for the "already configured" case). Since both branches set the exact same computed value (resolvedMinIntegrity/resolvedRepos), the call is now moved outside the conditional — keeping only the distinctcore.info()messages inside.Before:
After:
2. Simplified Boolean Logic (
pr_review_buffer.cjs)shouldAddFooterwas initialized tofalsewith a redundantelse if (footerMode === "none") { shouldAddFooter = false; }branch. Now initialized directly from the "always" check:Before:
After:
3. Clarified Comment (
mcp_environment.go)The comment
// Check for safe-outputs env varsappeared twice incollectMCPEnvironmentVariables. The second occurrence was misleading — that block adds the safe-outputs server connection details (port and API key), not theGH_AW_SAFE_OUTPUTSpassthrough above it. Clarified to// Add safe-outputs server connection env vars.Changes Based On
Recent merged PRs:
pr_review_buffer.cjsandsafe_output_handler_manager.cjs(skipped code-push, unresolvable line retry)determine_automatic_lockdown.cjs(remove GitHub App auth exemption)gh aw newagainst JSON schema; fixcreate-projectoneOf #21981 —commands.go+mcp_environment.go(validate safe-output names)Testing
determine_automatic_lockdown.test.cjs,pr_review_buffer.test.cjs)make build)TestCollectMCPEnvironmentVariables_*,TestBuildSafeOutputsSection,TestCreateWorkflowTemplateContainsOnlyValidSafeOutputs)make fmt— no formatting changes neededReferences: §23357917108
Note
🔒 Integrity filtering filtered 4 items
Integrity filtering activated and filtered the following items during workflow execution.
This happens when a tool call accesses a resource that does not meet the required integrity or secrecy level of the workflow.
gh aw newagainst JSON schema; fixcreate-projectoneOf #21981 (pull_request_read: Resource 'pr:fix: validate safe-output names ingh aw newagainst JSON schema; fixcreate-projectoneOf #21981' has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)pull_request_read: Resource 'pr:fix(codex): align execute step name to "Execute Codex CLI" #21972' has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)pull_request_read: Resource 'pr:fix: skipped code-push should not trigger fail-fast; retry PR review on unresolvable line #21976' has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)pull_request_read: Resource 'pr:security: remove Trivy action due to supply chain compromise #22007' has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)