You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix zizmor output: suppress 0 warnings, show details with location, run per-file (#2663)
* Initial plan
* Fix zizmor output: skip 0 warnings, show details, run per-file
- Skip displaying "🌈 zizmor 0 warnings" for files with 0 warnings
- Display detailed findings (severity and type) for each warning
- Run zizmor per-file as each workflow compiles instead of all at the end
- Update tests to match new behavior
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* Run go fmt
* Remove unused runZizmor function and console import
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* Fix integration test for new zizmor behavior
Updated TestCompileWithZizmor to handle the new behavior where
workflows with 0 warnings don't display any zizmor output.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* Add detailed zizmor output with file, line, column, and description
- Updated zizmorFinding struct to capture desc, url, annotation, and location info
- Modified display logic to show line number, column number, and description
- Used console.FormatErrorMessage for consistent error formatting
- Updated all tests with enhanced JSON structure and expected output
- Line/column numbers are displayed in 1-based indexing for user readability
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
returnfmt.Errorf("strict mode: zizmor found %d security warnings/errors - workflows must have no zizmor findings in strict mode", totalWarnings)
108
+
returnfmt.Errorf("strict mode: zizmor found %d security warnings/errors in %s - workflows must have no zizmor findings in strict mode", totalWarnings, filepath.Base(lockFile))
106
109
}
107
110
// In non-strict mode, findings are logged but not treated as errors
108
111
returnnil
109
112
}
110
113
// Other exit codes are actual errors
111
-
returnfmt.Errorf("zizmor failed with exit code %d", exitCode)
114
+
returnfmt.Errorf("zizmor failed with exit code %d on %s", exitCode, filepath.Base(lockFile))
112
115
}
113
116
// Non-ExitError errors (e.g., command not found)
114
-
returnfmt.Errorf("zizmor failed: %w", err)
115
-
}
116
-
117
-
ifverbose {
118
-
fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Zizmor security scan completed - no findings"))
117
+
returnfmt.Errorf("zizmor failed on %s: %w", filepath.Base(lockFile), err)
0 commit comments