Skip to content

fix: harden CI/CD workflows per zizmor audit#6

Open
KeremP wants to merge 3 commits intomainfrom
fix/zizmor-workflow-hardening
Open

fix: harden CI/CD workflows per zizmor audit#6
KeremP wants to merge 3 commits intomainfrom
fix/zizmor-workflow-hardening

Conversation

@KeremP
Copy link
Copy Markdown

@KeremP KeremP commented Mar 23, 2026

Summary

Remediate all findings from zizmor static analysis across both GitHub Actions workflow files.

ci.yml:

  • Added permissions: {} at workflow level and permissions: { contents: read } at job level (excessive-permissions)
  • Added persist-credentials: false to checkout (artipacked)
  • Pinned actions/checkout and actions/setup-node to SHA hashes (unpinned-uses)

release.yml:

  • Added persist-credentials: false to checkout (artipacked)
  • Pinned actions/checkout and actions/setup-node to SHA hashes (unpinned-uses)
  • Added environment: release to the job (secrets-outside-env) — you'll need to create a "release" environment in your repo's Settings > Environments and add the NPM_TOKEN secret there
  • Replaced all ${{ steps.check.outputs.* }} in run: blocks with env: variables (template-injection)
  • Replaced softprops/action-gh-release with gh release create (superfluous-actions, unpinned-uses, cache-poisoning)

Test plan

  • zizmor . reports 0 findings (5 suppressed)
  • Verify CI workflow still passes on PRs
  • Create "release" environment in repo settings and move NPM_TOKEN secret there
  • Test a release cycle end-to-end

Note

Medium Risk
Touches CI/release automation and permissioning; mistakes could block releases or tagging, but changes are largely security hardening and action pinning.

Overview
Hardens GitHub Actions CI and release workflows per security audit findings.

CI now defaults to permissions: {} with job-scoped contents: read, pins actions/checkout/actions/setup-node to SHAs, and disables checkout credential persistence.

Release now runs in a protected environment: release, avoids expression interpolation inside shell scripts by moving values to env, and replaces softprops/action-gh-release with direct gh release create using GH_TOKEN for publishing GitHub releases.

Written by Cursor Bugbot for commit 6025e28. This will update automatically on new commits. Configure here.

Remediate all zizmor findings across both workflow files:

ci.yml:
- Add permissions: {} at workflow level and contents: read at job level
- Add persist-credentials: false to checkout
- Pin actions/checkout and actions/setup-node to SHA hashes

release.yml:
- Add persist-credentials: false to checkout
- Pin actions/checkout and actions/setup-node to SHA hashes
- Add environment: release to the job for secrets scoping
- Replace ${{ steps.check.outputs.* }} in run blocks with env variables
- Replace softprops/action-gh-release with gh release create
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: persist-credentials: false breaks git push in release workflow
    • Removed persist-credentials: false from release workflow checkout step to allow git push operations to authenticate using the default persisted credentials.

Comment thread .github/workflows/release.yml Outdated
cursoragent and others added 2 commits March 23, 2026 18:36
… git push

The release workflow needs to push git tags, which requires authentication.
Setting persist-credentials: false removes the credential helper configured
by actions/checkout, causing git push to fail. Removing this setting allows
the default behavior (persist-credentials: true) which preserves credentials
for authenticated git operations.
The artipacked finding doesn't apply here — this workflow never
uploads artifacts, so there's no vector for credential leakage.
Keeping credentials allows the downstream git push step to work.
Added inline zizmor suppression comment.
@KeremP KeremP requested a review from joshkotrous March 25, 2026 13:34
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.

2 participants