Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…s in config.json Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
March 14, 2026 02:36
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for emitting close_pull_request safe-outputs configuration into the generated config.json used by the safe-outputs MCP server.
Changes:
- Generate
close_pull_requesthandler config (max/target/allowed_repos + required label/title filters). - Forward
github-tokenandstagedsettings forclose_pull_request. - Add unit tests validating the generated
close_pull_requestconfig JSON (including staged/token behavior).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/workflow/safe_outputs_config_generation.go | Adds generation of close_pull_request config with optional filters/token/staged. |
| pkg/workflow/safe_outputs_config_generation_test.go | Adds tests covering close_pull_request config emission and staged behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+108
to
+127
| if data.SafeOutputs.ClosePullRequests != nil { | ||
| additionalFields := make(map[string]any) | ||
| if len(data.SafeOutputs.ClosePullRequests.RequiredLabels) > 0 { | ||
| additionalFields["required_labels"] = data.SafeOutputs.ClosePullRequests.RequiredLabels | ||
| } | ||
| if data.SafeOutputs.ClosePullRequests.RequiredTitlePrefix != "" { | ||
| additionalFields["required_title_prefix"] = data.SafeOutputs.ClosePullRequests.RequiredTitlePrefix | ||
| } | ||
| if data.SafeOutputs.ClosePullRequests.GitHubToken != "" { | ||
| additionalFields["github-token"] = data.SafeOutputs.ClosePullRequests.GitHubToken | ||
| } | ||
| if data.SafeOutputs.ClosePullRequests.Staged { | ||
| additionalFields["staged"] = true | ||
| } | ||
| safeOutputsConfig["close_pull_request"] = generateTargetConfigWithRepos( | ||
| data.SafeOutputs.ClosePullRequests.SafeOutputTargetConfig, | ||
| data.SafeOutputs.ClosePullRequests.Max, | ||
| 1, // default max | ||
| additionalFields, | ||
| ) |
This was referenced Mar 15, 2026
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.
close_pull_requestwas correctly compiled intoGH_AW_SAFE_OUTPUTS_HANDLER_CONFIGbut never written to/opt/gh-aw/safeoutputs/config.json. The MCP server usesconfig.jsonto decide which tools to register, soclose_pull_requestwas silently skipped at runtime — agent could see it in the prompt's tool list but couldn't call it.Changes
safe_outputs_config_generation.go: Added the missingclose_pull_requestblock togenerateSafeOutputsConfig, following the same pattern asclose_issuewith additional handling forgithub-tokenandstagedfields fromBaseSafeOutputConfigsafe_outputs_config_generation_test.go: Added tests covering the full field set and thestagedflag