You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(skill): add explicit gh CLI guidance for branch protection verification
- Require use of `gh repo view --json branchProtectionRules` to inspect rulesets
- If gh CLI unavailable, agent must stop and ask user for manual verification
- Prevents false negatives when API access is unavailable
- Add edge case warning about gh CLI dependency
Copy file name to clipboardExpand all lines: skills/github-repo-setup/SKILL.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,8 +28,11 @@ Evaluate repository compliance against contractually mandated BC Gov DevOps and
28
28
- Read workflow files under `.github/workflows/` to verify CI/CD pipelines fail on warnings and test coverage gates are enforced.
29
29
- Look at OpenShift deployment templates/manifests to verify security contexts (`runAsNonRoot: true`, `readOnlyRootFilesystem: true`).
30
30
-**Trace Renovate configuration inheritance**: If `renovate.json` extends presets (e.g., `github>bcgov/renovate-config`), fetch and analyze the inherited configuration files to determine effective settings, particularly `automerge`, `schedule`, and `minimumReleaseAge`.
31
-
3.**Assess Repo configuration (GitHub API/Git)**:
32
-
- Check local git configurations and repository parameters when querying. If online API tools are unavailable, perform manual reasoning on branch naming, rulesets, and pull requests.
31
+
3.**Assess Repo configuration (GitHub API via `gh` CLI)**:
32
+
- Use `gh repo view --json branchProtectionRules` to inspect branch protection rulesets on the `main` branch. Verify that rulesets enforce PR requirement, approvals, linear history, and status checks.
33
+
- If `gh` CLI is unavailable, **stop and ask the user** to manually verify branch protection rules in GitHub settings → Branches. Do not assume or guess about ruleset configuration.
34
+
- Check `gh repo view --json defaultBranchRef` for default branch naming and permissions.
35
+
- Inspect pull request templates (`.github/pull_request_template.md`) for compliance checklist enforcement.
33
36
4.**Draft the Compliance Scorecard**:
34
37
- Compare the findings against the BC Gov DevOps & Dependency Security Standards (detailed in the **Rules** section below).
35
38
- Use the reference template [REPORT_TEMPLATE.md](./resources/REPORT_TEMPLATE.md) as the format.
@@ -103,6 +106,7 @@ Always generate a `MATURITY_REPORT.md` file in the root of the audited repositor
103
106
-**Non-TypeScript Repositories**: Skip TypeScript-specific rules (strict mode, `@ts-ignore`). Assess applicable language-specific linting (ESLint for JavaScript, Pylint for Python, etc.).
104
107
-**Legacy Branch Names (`master`, `develop`)**: Audit still applies. Flag as a low-priority gap if org standards require `main`.
105
108
-**Exempt Repositories**: Repositories that are documentation-only, archived, or experimental should be skipped with a clear note in the report.
109
+
-**`gh` CLI Availability**: Branch protection rules cannot be reliably inspected without the GitHub CLI (`gh`). If `gh` is unavailable, explicitly note in the report: "Branch protection ruleset verification requires GitHub CLI (`gh repo view --json branchProtectionRules`). Manual inspection recommended." Do not report rulesets as missing or non-compliant without evidence.
106
110
107
111
## References
108
112
@@ -113,3 +117,4 @@ Always generate a `MATURITY_REPORT.md` file in the root of the audited repositor
113
117
-[Renovate Documentation](https://docs.renovatebot.com/) – Preset inheritance, extends chains, and configuration best practices.
114
118
-[MATURITY_REPORT.md Template](./resources/REPORT_TEMPLATE.md) – Structured report template for compliance scoring and remediation tracking.
115
119
-[Kubernetes Security Best Practices](https://kubernetes.io/docs/concepts/security/) – Pod security standards, security contexts, and RBAC.
0 commit comments