feat: add apply-rulesets.sh to create code-quality ruleset#71
Merged
feat: add apply-rulesets.sh to create code-quality ruleset#71
Conversation
Adds scripts/apply-rulesets.sh — an IaC script that creates or updates the code-quality repository ruleset (required status checks) for any petry-projects repo via the GitHub API. The script: - Auto-detects which CI workflows are present and derives the correct GitHub Actions check context strings (<workflow-name> / <job-name>) - Supports --dry-run to preview without applying - Creates or updates the ruleset idempotently (POST or PUT) - Supports --all to run across every non-archived org repo Closes #49 Co-authored-by: don-petry <don-petry@users.noreply.github.com>
- Remove unused workflow_job_names() helper — dead code never called - Guard printf against empty array with set -u on older bash versions Co-authored-by: don-petry <don-petry@users.noreply.github.com>
Co-authored-by: don-petry <don-petry@users.noreply.github.com>
|
This was referenced Apr 6, 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.



Summary
scripts/apply-rulesets.sh— an IaC script that creates or updates thecode-qualityrepository ruleset (required status checks) for anypetry-projectsrepo via the GitHub API<workflow-name> / <job-name>)--dry-runto preview without applying, and--allto run across every non-archived org repoHow to apply after merging
Once the ruleset is created in GitHub settings, the weekly compliance audit will close issue #49 automatically.
Test plan
--dry-runagainst.githubrepo and verify expected output.githubrepo with a real admin tokencode-qualityruleset appears in repo settingsCloses #49
Generated with Claude Code