🌱 Use rulesets if one exists when classic branch protection rule is inaccessible#4853
Merged
Merged
Conversation
Signed-off-by: Trask Stalnaker <trask.stalnaker@gmail.com>
813125d to
4e140f9
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4853 +/- ##
==========================================
+ Coverage 66.80% 69.59% +2.78%
==========================================
Files 230 251 +21
Lines 16602 15657 -945
==========================================
- Hits 11091 10896 -195
+ Misses 4808 3891 -917
- Partials 703 870 +167 🚀 New features to boost your workflow:
|
Member
|
/scdiff generate Branch-Protection |
spencerschrock
approved these changes
Nov 20, 2025
spencerschrock
left a comment
Member
There was a problem hiding this comment.
Thanks. I tested this on actions/checkout with a fine grained PAT and it fixed the check.
Note to self: We already had some code duplication between setup and query, and now there's even more. It would be nice to cleanup eventually
thomasleplus
pushed a commit
to thomasleplus/scorecard
that referenced
this pull request
Mar 8, 2026
Signed-off-by: Trask Stalnaker <trask.stalnaker@gmail.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.
What kind of change does this PR introduce?
What is the current behavior?
Currently, when a classic branch protection rule is inaccessible (no special github token provided to access it):
What is the new behavior (if this is a feature change)?**
These two behaviors match. In both cases, it will see if there is a ruleset for the branch and use it if one exists.
I didn't find any existing tests for this code (either the default or non-default branch case). I can introduce if you wish.
Which issue(s) this PR fixes
NONE
Special notes for your reviewer
Does this PR introduce a user-facing change?
For user-facing changes, please add a concise, human-readable release note to
the
release-note(In particular, describe what changes users might need to make in their
application as a result of this pull request.)