Add Fix-BranchRuleset.ps1 and update Setup-BranchRuleset.ps1#63
Merged
Conversation
…yaml - Add Fix-BranchRuleset.ps1: inspects, disables, and renames existing rulesets so Setup-BranchRuleset.ps1 can recreate them cleanly - Update Setup-BranchRuleset.ps1 to match current repo-template with correct repository name and status check names - Switch pr.yaml to pull_request_target for secure workflow execution - Add explicit ref and persist-credentials: false to all checkout steps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…uccess Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…leset-scripts # Conflicts: # .github/workflows/pr.yaml # scripts/Fix-BranchRuleset.ps1
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s branch-protection automation to better align ruleset enforcement with the current CI workflow naming and to support safely “resetting” existing rulesets so they can be recreated cleanly.
Changes:
- Add
Fix-BranchRuleset.ps1to disable/rename existing rulesets to unblock re-creation. - Update
Setup-BranchRuleset.ps1required status check names to match the current staged CI job names. - Update the PR workflow configuration (trigger / checkout hardening) to support secure execution.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/Setup-BranchRuleset.ps1 | Updates required status check context names for the ruleset and the post-create summary output. |
| scripts/Fix-BranchRuleset.ps1 | Adds a remediation script to disable existing rulesets and rename the default ruleset name to avoid conflicts. |
| .github/workflows/pr.yaml | Defines the staged CI job names that the ruleset’s required status checks must match. |
- Add Stage 3 (.NET Framework) to required_status_checks - Add warning about paths-ignore blocking required checks - Fix stale reference to codeql.yml (may not exist in all repos) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The pr.yaml workflow references this file for test coverage settings. Without it, dotnet test fails with "Settings file could not be found". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Fix-BranchRuleset.ps1: inspects existing rulesets, disables them, and renames any "Protect main branch" ruleset to allow clean recreationSetup-BranchRuleset.ps1to match current repo-template with correct repository name and status check namespull_request_targetfor secure workflow executionrefandpersist-credentials: falseto all checkout stepsTest plan
Fix-BranchRuleset.ps1and verify it lists planned changes before promptingSetup-BranchRuleset.ps1and verify it creates the ruleset with correct status check names🤖 Generated with Claude Code