Skip to content

fix(ci): harden all workflows per zizmor audit#105

Merged
pesap merged 4 commits intomainfrom
pesap/zizmor-ci-hardening
Mar 16, 2026
Merged

fix(ci): harden all workflows per zizmor audit#105
pesap merged 4 commits intomainfrom
pesap/zizmor-ci-hardening

Conversation

@pesap
Copy link
Collaborator

@pesap pesap commented Mar 16, 2026

Summary

  • Pin all 31 action references to commit SHAs to prevent supply-chain attacks
  • Add explicit least-privilege permissions at workflow and job level across all workflows
  • Set persist-credentials: false on every checkout step (9 total)
  • Scope release.yaml permissions per job instead of broad workflow-level grants
  • Delete legacy publish_pypi.yaml (redundant with release.yaml trusted publishing)
  • Suppress pull_request_target warning in labeler.yaml (correct usage pattern)

Motivation

zizmor audit flagged 75 findings (36 high, 11 medium, 9 low, 1 info) across 6 workflow files. After this PR: 1 acceptable warning (codecov secret outside dedicated environment).

Files Changed

File Changes
CI.yaml SHA pins, permissions: {} top-level, job-level contents: read, persist-credentials: false
commit.yaml SHA pins, permissions: {} top-level, job-level contents: read, persist-credentials: false
docs.yaml SHA pins, permissions: contents: write, persist-credentials: false
labeler.yaml SHA pins, persist-credentials: false, zizmor: ignore[dangerous-triggers]
publish_pypi.yaml Deleted (superseded by release.yaml trusted publishing)
release.yaml SHA pins, permissions: {} top-level, per-job least-privilege, persist-credentials: false

Plan: docs/plans/2026-03-15-zizmor-ci-hardening.md

- Pin all action references to commit SHAs (31 unpinned-uses resolved)
- Add explicit least-privilege permissions at workflow and job level
- Set persist-credentials: false on every checkout step
- Scope release.yaml permissions per job instead of workflow-level
- Delete legacy publish_pypi.yaml (redundant with release.yaml trusted publishing)
- Suppress pull_request_target warning in labeler.yaml (correct usage)

Reduces zizmor findings from 75 (36 high) to 1 acceptable warning
(codecov secret outside dedicated environment).
@github-actions github-actions bot removed the docs label Mar 16, 2026
@codecov-commenter
Copy link

codecov-commenter commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.63%. Comparing base (1ea4a39) to head (eab1602).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #105   +/-   ##
=======================================
  Coverage   95.63%   95.63%           
=======================================
  Files           8        8           
  Lines        1719     1719           
=======================================
  Hits         1644     1644           
  Misses         75       75           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- Rewrite README with proper badges, description, quick start, and uv dev setup
- Update all URLs from NREL/plexosdb to NatLabRockies/plexosdb (README + pyproject.toml)
- Add .prettierrc.yaml (printWidth: 80, proseWrap: always)
- Add prettier hook for markdown in pre-commit config
- Migrate pre-commit-hooks from GitHub repo to builtin
- Add extra builtin hooks (detect-private-key, no-commit-to-branch, check-xml, etc.)
- Reformat all markdown docs with prettier
- Replace pre-commit with prek in dev dependencies
- Rename CI job from pre-commit to prek, use prek run command
- Update README developer setup to use prek install
@pesap pesap merged commit 67ca845 into main Mar 16, 2026
26 checks passed
@pesap pesap deleted the pesap/zizmor-ci-hardening branch March 16, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants