-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add composite actions, enhanced governance, and GitHub Issue reports #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b239275
feat: add composite actions, enhanced governance, and GitHub Issue re…
gamaware d83bc29
feat: add architecture docs, runbooks, and Claude Code skills
gamaware 5ea0394
fix: preserve existing status check contexts during branch protection…
gamaware fd965c9
fix: address review comments and absorb Dependabot version bumps
gamaware a494e5d
fix: update stale action SHA pins and zizmor version
gamaware b98ffb2
fix: add persist-credentials false to all checkout steps (zizmor arti…
gamaware 6570f77
fix: resolve Semgrep shell injection and zizmor warnings
gamaware 86835e7
fix: correct zizmor config syntax for secrets-outside-env
gamaware 60cf8e3
fix: address code review feedback on zizmor config and drift issue cr…
gamaware File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| name: add-repo-override | ||
| description: Add a per-repo settings override to overrides.json | ||
| user-invocable: true | ||
| --- | ||
|
|
||
| # Add Repository Override | ||
|
|
||
| Add a per-repo exception to `config/overrides.json`. | ||
|
|
||
| ## Arguments | ||
|
|
||
| `$ARGUMENTS` should be in the format: `<repo-name> <setting-path> <value>` | ||
|
|
||
| Examples: | ||
|
|
||
| - `my-repo branch_protection.required_status_checks.contexts '["Build","Test"]'` | ||
| - `my-repo repo_settings.has_wiki true` | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Read the current `config/overrides.json` | ||
| 2. Parse `$ARGUMENTS` to extract repo name, setting path, and value | ||
| 3. Add or update the override for the specified repo | ||
| 4. Validate the resulting JSON with `jq empty` | ||
| 5. Show the diff of what changed | ||
| 6. Remind the user to create a PR for the change |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| name: audit | ||
| description: Run a dry-run settings audit across all repositories | ||
| user-invocable: true | ||
| disable-model-invocation: true | ||
| --- | ||
|
|
||
| # Audit Repository Settings | ||
|
|
||
| Run a dry-run sync to check for drift without applying changes. | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Run the sync script in dry-run mode: | ||
|
|
||
| ```bash | ||
| ./scripts/sync-repo-settings.sh --dry-run | ||
| ``` | ||
|
|
||
| 1. Display the report: | ||
|
|
||
| ```bash | ||
| cat reports/sync-report.md | ||
| ``` |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| name: exclude-repo | ||
| description: Exclude a repository from settings governance | ||
| user-invocable: true | ||
| --- | ||
|
|
||
| # Exclude Repository | ||
|
|
||
| Add a repository to the exclusion list in `config/overrides.json`. | ||
|
|
||
| ## Arguments | ||
|
|
||
| `$ARGUMENTS` should be the repository name to exclude. | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Read the current `config/overrides.json` | ||
| 2. Add `$ARGUMENTS` to the `excluded` array (if not already present) | ||
| 3. Validate the resulting JSON with `jq empty` | ||
| 4. Show the updated exclusion list | ||
| 5. Remind the user to create a PR for the change |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| # Pull Request | ||
|
|
||
| ## What changed | ||
|
|
||
| <!-- Brief description of the change --> | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Security Scan | ||
| description: Run SAST and SCA security scans | ||
|
|
||
| inputs: | ||
| scan-path: | ||
| description: Path to scan | ||
| required: false | ||
| default: "." | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Run Semgrep SAST | ||
| uses: semgrep/semgrep-action@713efdd345f3035192eaa63f56867b88e63e4e5d # v1.0.0 | ||
| with: | ||
| config: auto | ||
|
|
||
| - name: Run Trivy vulnerability scanner | ||
| if: always() | ||
| uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0 | ||
| with: | ||
| scan-type: fs | ||
| scan-ref: ${{ inputs.scan-path }} | ||
| format: sarif | ||
| output: trivy-results.sarif | ||
|
|
||
| - name: Upload Trivy results to GitHub Security | ||
| uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 | ||
| if: always() | ||
| with: | ||
| sarif_file: trivy-results.sarif |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: Sync Repository Settings | ||
| description: Compare and apply GitHub settings across all repos against a baseline | ||
|
|
||
| inputs: | ||
| mode: | ||
| description: "Run mode: --dry-run or --apply" | ||
| required: true | ||
| default: "--dry-run" | ||
| github_token: | ||
| description: PAT with repo and admin scopes | ||
| required: true | ||
|
|
||
| outputs: | ||
| report_file: | ||
| description: Path to the generated report | ||
| value: ${{ steps.sync.outputs.report_file }} | ||
| total_repos: | ||
| description: Number of repos scanned | ||
| value: ${{ steps.parse.outputs.total_repos }} | ||
| compliant: | ||
| description: Number of compliant repos | ||
| value: ${{ steps.parse.outputs.compliant }} | ||
| drift: | ||
| description: Number of repos with drift | ||
| value: ${{ steps.parse.outputs.drift }} | ||
| has_drift: | ||
| description: Whether any drift was detected | ||
| value: ${{ steps.parse.outputs.has_drift }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Run settings sync | ||
| id: sync | ||
| shell: bash | ||
| env: | ||
| GH_TOKEN: ${{ inputs.github_token }} | ||
| REPORT_FILE: reports/sync-report.md | ||
| SYNC_MODE: ${{ inputs.mode }} | ||
| run: | | ||
| ./scripts/sync-repo-settings.sh "$SYNC_MODE" | ||
| echo "report_file=reports/sync-report.md" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Parse report | ||
| id: parse | ||
| shell: bash | ||
| run: ./scripts/generate-report.sh reports/sync-report.md |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Update Pre-commit Hooks Composite Action | ||
| description: Updates pre-commit hook versions and creates a PR | ||
|
|
||
| inputs: | ||
| github_token: | ||
| description: GitHub token for creating PRs | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Set up Python | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: "3.x" | ||
|
|
||
| - name: Install pre-commit | ||
| shell: bash | ||
| run: pip install pre-commit | ||
|
|
||
| - name: Update hooks | ||
| shell: bash | ||
| run: pre-commit autoupdate | ||
|
|
||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 | ||
| with: | ||
| token: ${{ inputs.github_token }} | ||
| commit-message: "chore: update pre-commit hook versions" | ||
| title: "chore: update pre-commit hook versions" | ||
| body: | | ||
| Automated update of pre-commit hook versions. | ||
|
|
||
| Review the changes to `.pre-commit-config.yaml` and merge if CI passes. | ||
| branch: chore/update-pre-commit-hooks | ||
| delete-branch: true |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only checks section presence, not the baseline schema.
Lines 85-91 will still pass if
security.vulnerability_alertsis missing or if a label entry omitscolor/description. That leaves the new baseline contract effectively unvalidated.Suggested jq-based validation
- name: Validate baseline schema run: | - ERRORS=0 - for section in repo_settings security branch_protection labels required_files; do - if ! jq -e ".$section" config/baseline.json > /dev/null 2>&1; then - echo "ERROR: Missing section '$section' in baseline.json" - ERRORS=$((ERRORS + 1)) - else - echo "OK: section '$section' present" - fi - done - if [ "$ERRORS" -gt 0 ]; then - echo "ERROR: baseline.json schema validation failed" - exit 1 - fi + jq -e ' + (.repo_settings | type == "object") and + (.security | type == "object") and + (.security.vulnerability_alerts | type == "boolean") and + (.branch_protection | type == "object") and + (.required_files | type == "array") and + (.labels | type == "array") and + ([.labels[] | (.name | type == "string") + and (.color | type == "string" and test("^[0-9A-Fa-f]{6}$")) + and (.description | type == "string")] | all) + ' config/baseline.json >/dev/null || { + echo "ERROR: baseline.json schema validation failed" + exit 1 + }As per coding guidelines, "Confirm the JSON structure aligns with the baseline schema validated by quality checks (Validate baseline schema step) and used by per-repo drift/metadata checks."
📝 Committable suggestion
🤖 Prompt for AI Agents