Repository navigation
fix(devtools): skip what a private repository's plan does not offer - #58
Merged
Merged
Conversation
repo-settings.sh stopped at the first private repository: on the Free plan GitHub refuses its rulesets with a 403, and the script exited 1, which callers read as "differs". Rulesets, secret scanning and private vulnerability reporting are now skipped with a note when GitHub does not offer them, and a skip is not a difference. Any request that fails for another reason exits 2. Closes #56
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 changed, and why
Closes #56.
repo-settings.shstopped at the first private repository. On the Free plan GitHub refuses a private repository's rulesets with a 403; the script exited 1 there, which--checkcallers (github-setup.shin the projects) read as "differs", and an org-wide apply never reached the repositories after it.security_and_analysis: null, because it travels in the samePATCHas the merge settings.{"message":"Not Found",…}that leaked into the private vulnerability reporting line is gone..devtools/test-repo-settings.sh, run byself-lint. It uses a stand-in forgh, so it needs no token.Not a breaking change for consumers: the arguments and the output layout are the same, and exit codes 0 and 1 mean what they did.
How it was tested
bash .devtools/test-repo-settings.sh: 23 checks pass. Against the script onmain, 17 of them fail.Read-only, against the real repositories:
shellcheckand the lefthook pre-commit hooks pass.Not tested: applying to a real private repository. Only
--checkwas run against GitHub. The apply path on a private repository is covered by the stand-in alone, so whether GitHub accepts the remaining settings there is unconfirmed until someone runs it.The run above also shows
.github's ownchecks-dotgithubruleset is out of step withrulesets/checks-dotgithub.json(thelint / lefthookcheck is not on the repository yet). That predates this change and is not touched here.Checklist
branch follows Conventional Branch
gh stackif not)uses:pinned to a full SHA with a# vX.Y.Zcomment$/from a workflow, SHA-pinned from a template(
sh .devtools/check-action-pins.sh)permissions: {}at workflow level; each job asks for the least it needsv1