Suppress wildcard fetch warning for public repos#20955
Merged
Merged
Conversation
Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
dsyme
March 14, 2026 16:05
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds repository-visibility awareness to the workflow compiler so the push-to-pull-request-branch wildcard-fetch warning is suppressed for public repositories, and wires up CLI-side visibility detection.
Changes:
- Introduces
Compiler.isPublicRepoplusWithPublicRepo/SetPublicRepoto record repo visibility. - Suppresses the
target: "*"wildcard-fetch warning when the repo is known to be public. - CLI now attempts to detect repo visibility via
gh apiand passes it into the compiler; includes a new unit test for the warning behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pkg/workflow/push_to_pull_request_branch_warning_test.go | Adds coverage to ensure wildcard-fetch warning is suppressed when repo visibility is public. |
| pkg/workflow/push_to_pull_request_branch_validation.go | Gates wildcard-fetch warning on repo visibility (public repos suppress). |
| pkg/workflow/compiler_types.go | Adds repo visibility field and configuration hooks to the compiler. |
| pkg/cli/compile_compiler_setup.go | Detects repo visibility via gh api during compiler setup and passes it into the compiler. |
💡 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
dsyme
reviewed
Mar 14, 2026
…thod Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
dsyme
approved these changes
Mar 14, 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.
The
push-to-pull-request-branch: target: "*"wildcard fetch warning is irrelevant for public repos — all PR branches are always accessible without special fetch configuration in OSS repos.Changes
computeIsPublicRepo()— new method on*Compilerinpush_to_pull_request_branch_validation.gothat queriesgh api /repos/{slug} --jq .visibilityon demand, returningtrueonly when the API confirms the repo is public; validatesowner/reposlug format and returnsfalseon any failurevalidatePushToPullRequestBranchWarnings— gates the wildcard fetch warning on!c.computeIsPublicRepo(); visibility is resolved lazily, only when the warning is about to fireSafe-by-default: if visibility cannot be determined (no auth, network error, missing or malformed slug), the warning is still shown.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.