Skip to content

Scan workflows with zizmor - #16

Open
myabc wants to merge 1 commit into
mainfrom
ci/zizmor-scan
Open

Scan workflows with zizmor#16
myabc wants to merge 1 commit into
mainfrom
ci/zizmor-scan

Conversation

@myabc

@myabc myabc commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Adds the zizmor workflow-security scan used by openproject-octicons and primer_view_components: pull requests touching .github/workflows/** or .github/actions/** are audited, findings go to code scanning, and the job can also be run by hand via workflow_dispatch.

A verbatim copy would have landed red — zizmor 1.29 reported 6 high and 2 low findings against the workflows already in this repo, so this PR fixes those too:

  • unpinned-uses (6, high): every uses: is now pinned to a commit hash with the tag in a trailing comment. Dependabot understands this form and updates the hash and the comment together.
  • artipacked (2, low): both checkouts now set persist-credentials: false. The test workflow never pushed anything, and changesets/action pushes through the GitHub API rather than the git CLI, so neither needs the credentials on disk.

zizmor --offline .github/workflows/ is clean locally. Three pedantic-persona findings remain unaddressed and are out of scope here, since the default persona does not report them: job-level concurrency limits, workflow-level permissions in release.yml being broader than any single step needs, and permissions blocks without explanatory comments.

Two deviations from the sibling repos, both deliberate: checkout is pinned to v7 to match the rest of this repo rather than the v6 they use, and zizmor-action is at the current v0.6.2 rather than v0.5.3.

The release.yml changes cannot be exercised by this PR — that workflow only runs on push to main, so the credentials change is verified by the next release run.

Mirrors the zizmor-scan workflow used by openproject-octicons and
primer_view_components: pull requests that touch workflow files get
audited, with results uploaded to code scanning.

Getting to a clean run needed two changes to the existing workflows.
zizmor's blanket policy wants actions pinned to a commit hash, so every
uses: now carries a SHA with the tag in a trailing comment; Dependabot
updates both together. Checkout also drops its credentials, which the
test workflow never needed and which changesets/action does not use
either, since it pushes through the GitHub API.

The scan workflow itself pins checkout to the same v7 as the rest of the
repo rather than the v6 the sibling repos use, and takes the current
zizmor-action release.
Copilot AI lite review requested due to automatic review settings August 18, 2026 11:55
@github-advanced-security

Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a dedicated GitHub Actions workflow to run zizmor on workflow/action changes and hardens existing workflows to satisfy zizmor findings (pinning uses: to commit SHAs and disabling persisted checkout credentials where not needed).

Changes:

  • Introduces a zizmor-scan workflow that runs on PRs touching .github/workflows/** / .github/actions/** and on workflow_dispatch, uploading findings to code scanning.
  • Pins GitHub Action uses: references to commit SHAs (with tag comments) to address unpinned-uses.
  • Sets actions/checkout persist-credentials: false in relevant workflows to address artipacked.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
.github/workflows/zizmor-scan.yml Adds zizmor workflow-security scanning with SARIF upload on workflow/action changes.
.github/workflows/test.yml Pins action versions and disables persisted checkout credentials in CI tests.
.github/workflows/release.yml Pins action versions and disables persisted checkout credentials for the release workflow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants