Add workflow authoring standards, actionlint/zizmor gate, and CONTRIB…#32
Add workflow authoring standards, actionlint/zizmor gate, and CONTRIB…#32ms280690 wants to merge 5 commits into
Conversation
…UTING guide - Add .pre-commit-config.yaml with actionlint (v1.7.12) and zizmor (v1.25.2) hooks - Add .github/workflows/workflow-lint.yml — CI gate running actionlint via reviewdog and zizmor with SARIF upload to GitHub Security tab; triggers on PRs touching any workflow or action YAML file - Add CONTRIBUTING.md with workflow authoring checklist, SHA pinning instructions, and security pillars reference table - Pin and upgrade action refs in terramate-opentofu-setup/action.yml: opentofu/setup-opentofu v1.0.6 → v2.0.1 (SHA pinned) terramate-io/terramate-action v3.0.0 (SHA pinned) Closes #25 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Code ReviewStrengths
Issues1. - name: Install zizmor
run: pip install zizmor==1.25.2
- name: Run zizmor
run: zizmor --format sarif . > zizmor-results.sarifThe CONTRIBUTING checklist explicitly requires 2. zizmor installed via run: pip install zizmor==1.25.2Version is pinned, but PyPI packages can be replaced after the fact. For a workflow whose purpose is supply-chain hardening, this is an ironic gap. Consider either:
3.
4.
5. CONTRIBUTING.md hardcodes 2. Assign to `ms280690`, type: Feature, ...This embeds a personal username in org-wide guidance. If ownership changes this silently becomes stale. Consider replacing with a team handle (e.g., 6. Renovate reference may mislead Renovate (issue #8) is configured to keep pinned SHAs current automatically...This implies Renovate is already active. If issue #8 is still open/pending, contributors may skip manual SHA updates expecting Renovate to handle it. Worth adding "once configured" or noting the current status. Priority before merging
Items 3–6 are lower priority but worth addressing for long-term maintainability. |
There was a problem hiding this comment.
Pull request overview
Adds repo-level standards and automated enforcement for safer GitHub Actions workflow/composite-action authoring, aligning with Issue #25 by introducing local pre-commit linting plus a CI “workflow lint” gate, and by tightening action supply-chain security via SHA pinning.
Changes:
- Added
CONTRIBUTING.mddocumenting workflow authoring/security standards and local setup. - Added
.pre-commit-config.yamlwithactionlintandzizmorhooks for local enforcement. - Added
.github/workflows/workflow-lint.ymlCI gate to runactionlint(via reviewdog) andzizmor(with SARIF upload), and pinned action references in an existing composite action.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
CONTRIBUTING.md |
Documents workflow authoring checklist, SHA pinning guidance, and security reference table. |
.pre-commit-config.yaml |
Adds local actionlint + zizmor pre-commit hooks pinned to specific revisions. |
.github/workflows/workflow-lint.yml |
Introduces CI lint gate for workflow/action YAML changes, including SARIF upload. |
.github/actions/terramate-opentofu-setup/action.yml |
Pins action dependencies to commit SHAs for supply-chain hardening. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…c fixes - Add shell: bash to Install zizmor and Run zizmor steps (checklist compliance) - Replace pip install zizmor with --require-hashes against requirements/lint.txt (zizmor==1.25.2 wheel SHA256 pinned; no transitive deps) - Switch actionlint reporter from github-pr-review to github-check so annotations work in both pull_request and workflow_call contexts - Add inline comment to workflow_call explaining it is intentionally zero-input - Remove hardcoded personal assignee from CONTRIBUTING.md - Clarify Renovate SHA automation as future state once issue #8 is configured Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Broaden shell requirement in CONTRIBUTING checklist from bash-only to explicit shell: (bash or pwsh) so Windows workflows are not blocked - Replace pull-requests: write with checks: write on actionlint job — github-check reporter needs checks: write, not pull-requests: write - Add continue-on-error: true to SARIF upload step so fork PRs are not blocked by 403 when security-events: write is unavailable; zizmor exit code still gates the job independently Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
actions/checkout v4 runs on Node 20 which is deprecated from June 2026 and removed September 2026. v6.0.2 ships the Node 24 runtime. codeql-action v3 is deprecated in December 2026; upgraded to v4.35.5. Both references updated in workflow-lint.yml and the CONTRIBUTING.md SHA-pinning example. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the three-step pip install + run + codeql upload with the official zizmorcore/zizmor-action (v0.5.6, SHA-pinned). The action handles installation, SARIF generation, and upload-sarif internally, removing the need for requirements/lint.txt and the continue-on-error fork-PR workaround. Version pinned to 1.25.2 via the version: input. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…UTING guide
Closes #25