Skip to content

Add Fix-BranchRuleset.ps1 and update Setup-BranchRuleset.ps1#63

Merged
Chris-Wolfgang merged 6 commits into
mainfrom
feature/fix-branch-ruleset-scripts
Apr 8, 2026
Merged

Add Fix-BranchRuleset.ps1 and update Setup-BranchRuleset.ps1#63
Chris-Wolfgang merged 6 commits into
mainfrom
feature/fix-branch-ruleset-scripts

Conversation

@Chris-Wolfgang
Copy link
Copy Markdown
Owner

Summary

  • Add Fix-BranchRuleset.ps1: inspects existing rulesets, disables them, and renames any "Protect main branch" ruleset to allow clean recreation
  • 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

Test plan

  • Run Fix-BranchRuleset.ps1 and verify it lists planned changes before prompting
  • Run Setup-BranchRuleset.ps1 and verify it creates the ruleset with correct status check names

🤖 Generated with Claude Code

Chris-Wolfgang and others added 4 commits March 27, 2026 21:41
…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
Copilot AI review requested due to automatic review settings April 7, 2026 03:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ps1 to disable/rename existing rulesets to unblock re-creation.
  • Update Setup-BranchRuleset.ps1 required 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.

Comment thread scripts/Setup-BranchRuleset.ps1
Comment thread scripts/Setup-BranchRuleset.ps1
Comment thread scripts/Setup-BranchRuleset.ps1 Outdated
Chris-Wolfgang and others added 2 commits April 7, 2026 20:22
- 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>
@Chris-Wolfgang Chris-Wolfgang merged commit 0dba43f into main Apr 8, 2026
6 checks passed
@Chris-Wolfgang Chris-Wolfgang deleted the feature/fix-branch-ruleset-scripts branch April 8, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants