Skip to content

feat: add apply-rulesets.sh to create code-quality ruleset#71

Merged
don-petry merged 3 commits intomainfrom
claude/issue-49-20260406-0343
Apr 6, 2026
Merged

feat: add apply-rulesets.sh to create code-quality ruleset#71
don-petry merged 3 commits intomainfrom
claude/issue-49-20260406-0343

Conversation

@claude
Copy link
Copy Markdown
Contributor

@claude claude Bot commented Apr 6, 2026

Summary

  • 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
  • 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, and --all to run across every non-archived org repo
  • Creates or updates the ruleset idempotently

How to apply after merging

# Dry-run first:
GH_TOKEN=<admin-token-with-administration-write> bash scripts/apply-rulesets.sh .github --dry-run

# Apply:
GH_TOKEN=<admin-token-with-administration-write> bash scripts/apply-rulesets.sh .github

Once the ruleset is created in GitHub settings, the weekly compliance audit will close issue #49 automatically.

Test plan

  • Run --dry-run against .github repo and verify expected output
  • Run against .github repo with a real admin token
  • Verify code-quality ruleset appears in repo settings
  • Confirm weekly compliance audit closes issue Compliance: missing-code-quality #49

Closes #49

Generated with Claude Code

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>
@claude claude Bot mentioned this pull request Apr 6, 2026
github-actions Bot and others added 2 commits April 6, 2026 03:47
- 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>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 6, 2026

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.

Compliance: missing-code-quality

1 participant