Skip to content

fix(zizmor): scan fork PRs in annotation mode instead of skipping - #3

Merged
gwarf merged 1 commit into
mainfrom
fix/zizmor-scan-fork-prs
Jun 26, 2026
Merged

fix(zizmor): scan fork PRs in annotation mode instead of skipping#3
gwarf merged 1 commit into
mainfrom
fix/zizmor-scan-fork-prs

Conversation

@gwarf

@gwarf gwarf commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Forward-port of EUDCH/.github#6 (EUDCH/.github#6, merged) so both orgs' reusable zizmor workflows handle fork PRs identically.

Problem

The reusable zizmor workflow skips fork PRs entirely. Because external contributors can only open fork PRs, the population whose workflow changes are most worth scanning gets no pre-merge zizmor coverage; their changes are only scanned on push to main after merge (detection, not prevention).

Fix

Don't skip fork PRs — downgrade them to annotation mode (advanced-security: false, no SARIF upload, findings as inline annotations). advanced-security is always forced off on a fork PR, so annotations is enabled for every fork PR (including advanced-security: false callers) without colliding with the mutually-exclusive advanced-security path.

The report-vs-block decision matches what the same change gets on a same-repo PR:

Caller Fork PR before Fork PR after
advanced-security: true, enforce: false skipped annotation, advisory
advanced-security: true, enforce: true skipped annotation, blocks
advanced-security: false skipped annotation, blocks by nature

Non-fork behaviour is byte-identical. The workflow logic is identical to the merged EUDCH version (only the org name in the usage-example header comment differs). zizmor is static analysis and never executes the scanned workflows, so running it on fork content is safe.

Verification

  • actionlint clean; zizmor v1.26.1 on the edited workflow: no findings.
  • Diffed against the merged EUDCH/.github copy: job logic identical.
  • Incorporates the review fix from EUDCH#6 (annotations enabled for all fork PRs, not just advanced-security: true callers).

operas-eu/.github has no README zizmor section and its CI-SECURITY.md makes no fork-skip claim, so this is a workflow-only change. Callers re-pin @<sha> to adopt.

Forward-port of EUDCH/.github#6. Fork PRs get a read-only GITHUB_TOKEN, so
the SARIF upload to the Security tab is impossible and the reusable workflow
skipped them entirely, leaving external contributors' workflow changes (the
highest-risk, most worth scanning) unchecked until after merge.

Downgrade fork PRs to annotation mode (advanced-security: false) instead of
skipping: findings surface as inline annotations. advanced-security is always
forced off on a fork PR, so annotations is enabled for every fork PR without
colliding with the mutually-exclusive advanced-security path. The report-vs-
block decision matches a same-repo PR: advisory under enforce: false, blocking
under enforce: true (and still always blocking for advanced-security: false
callers). Non-fork behaviour is byte-identical. zizmor is static analysis and
never executes the scanned workflows, so running it on fork content is safe.
Copilot AI review requested due to automatic review settings June 26, 2026 20:45

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

Updates the reusable .github/workflows/zizmor.yml workflow so fork-based pull requests are analyzed in “annotation mode” instead of being skipped, bringing behavior in line with the referenced upstream org workflow and improving pre-merge coverage for external contributors.

Changes:

  • Replace the fork-PR skip gate with fork detection (IS_FORK_PR) and conditional behavior.
  • Force advanced-security off and enable inline annotations for fork PRs while preserving non-fork behavior.
  • Adjust continue-on-error / enforcement flow so “report-only” stays advisory on fork PRs, but enforce/blocking modes still block on findings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gwarf
gwarf merged commit 40ee26b into main Jun 26, 2026
1 check passed
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