fix: robust zizmor severity split (in-job high-severity pass)#83
Conversation
Replace the fragile mid-run Checks-API annotation read (which raced and fell back to a generic warning) with a second zizmor pass at min-severity: high in the actions-audit job. Its outcome sets a has-errors output; the report job renders from it. Removes the report job's checks:read need and the cross-job timing race. Shows error vs warning distinctly (no exact counts). Part of geolonia-operations#196/#200.
WalkthroughThe reusable security suite workflow adds a second Zizmor pass for high-severity findings, propagates that result as a job output, and uses it in the report job to classify findings without querying check-run annotations. ChangesZizmor High-Severity Detection
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🛡️ Security suite
Warning Warnings only. These do not block the PR, but please review them. Updated for |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/reusable-security-suite.yml:
- Around line 207-214: The ZIZMOR summary logic in the workflow’s status-mapping
block should treat scan/job failures as errors before falling back to
warning-only findings. Update the conditional around ZIZMOR_STATUS,
ZIZMOR_HAS_ERRORS, and the summary message so a default/error status with no
explicit findings is reported as a job/scan failure rather than
“Warning-severity findings”; keep the warning branch only for true warning-only
results.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 56705fa7-03c9-40df-839f-f36aef48175b
📒 Files selected for processing (1)
.github/workflows/reusable-security-suite.yml
When actions-audit fails before publishing outputs, ZIZMOR_STATUS defaults to error; render it as a scan error (🟠, escalates the callout) before the warning-only branch, instead of mislabeling it warnings.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/reusable-security-suite.yml:
- Around line 209-213: The scan-error path in the reusable security workflow
still falls through to the same downstream branch as real finding severity, so
the callout text is misleading. Update the status handling around the
ZIZMOR_STATUS/ZIZMOR_SEV logic to track scan/job errors separately from finding
severity, and branch to a dedicated callout message for scan errors instead of
the existing “zizmor found error-severity issues” path. Use the existing
ZIZMOR_STATUS and ZIZMOR_SEV variables to locate and split the callout logic
cleanly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: f43cf943-4eef-4d96-aee6-4bb092159666
📒 Files selected for processing (1)
.github/workflows/reusable-security-suite.yml
| elif [ "${ZIZMOR_STATUS}" != "warn" ]; then | ||
| # status defaulted to "error" (the actions-audit job did not | ||
| # publish outputs, e.g. it failed/was skipped) -> surface it as a | ||
| # scan error, not warning-only findings. | ||
| ZIZMOR_GLYPH="🟠"; ZIZMOR_SEV="error"; ZIZMOR_MSG="Scan error (see run)" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Keep scan-error callouts distinct from finding callouts.
Line 213 correctly fixes the row text, but ZIZMOR_SEV="error" still reaches the downstream ZIZMOR_SEV=error callout branch, which says “zizmor found error-severity issues” even for a scan/job error. Track scan errors separately so the callout matches the row.
Proposed fix
+ ZIZMOR_SCAN_ERROR="false"
if [ "${ZIZMOR_STATUS}" = "ok" ]; then
ZIZMOR_GLYPH="✅"; ZIZMOR_SEV="ok"; ZIZMOR_MSG="No findings"
elif [ "${ZIZMOR_STATUS}" != "warn" ]; then
# status defaulted to "error" (the actions-audit job did not
# publish outputs, e.g. it failed/was skipped) -> surface it as a
# scan error, not warning-only findings.
- ZIZMOR_GLYPH="🟠"; ZIZMOR_SEV="error"; ZIZMOR_MSG="Scan error (see run)"
+ ZIZMOR_GLYPH="🟠"; ZIZMOR_SEV="error"; ZIZMOR_MSG="Scan error (see run)"; ZIZMOR_SCAN_ERROR="true"
elif [ "${ZIZMOR_HAS_ERRORS}" = "true" ]; then
ZIZMOR_GLYPH="❗"; ZIZMOR_SEV="error"
ZIZMOR_MSG="Error-severity findings (warn-only; see annotations)"Also update the callout branch:
- elif [ "${ZIZMOR_SEV}" = "error" ]; then
+ elif [ "${ZIZMOR_SCAN_ERROR}" = "true" ]; then
+ CALLOUT="> [!CAUTION]"$'\n'"> zizmor did not complete. See the workflow run."
+ elif [ "${ZIZMOR_SEV}" = "error" ]; then
CALLOUT="> [!CAUTION]"$'\n'"> zizmor found error-severity issues. They are warn-only (they do not block this PR), but please address them."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/reusable-security-suite.yml around lines 209 - 213, The
scan-error path in the reusable security workflow still falls through to the
same downstream branch as real finding severity, so the callout text is
misleading. Update the status handling around the ZIZMOR_STATUS/ZIZMOR_SEV logic
to track scan/job errors separately from finding severity, and branch to a
dedicated callout message for scan errors instead of the existing “zizmor found
error-severity issues” path. Use the existing ZIZMOR_STATUS and ZIZMOR_SEV
variables to locate and split the callout logic cleanly.
* chore: bump suite callers to reusable-security-suite@v1.25.0 Activates the robust in-job severity split (#83) via the ruleset, and drops the now-unneeded checks:read from the caller suite jobs (the report job no longer reads the Checks API). * chore: re-trigger suite on v1.25.0 caller
Supersedes the fragile Checks-API approach. The⚠️ warning-only + [!WARNING] from it — computed in-job, no cross-job annotation read, no
actions-auditjob now runs a second zizmor pass atmin-severity: high; its outcome becomes ahas-errorsoutput, and the report job renders ❗ error-severity + [!CAUTION] vschecks: read. Trade-off: distinction not exact counts (detail is in the annotations). After release, a chain bump points the callers at the new version (and drops the now-unneededchecks: read). Part of geolonia-operations#196 / #200.Summary by CodeRabbit