Add strict mode enforcement for zizmor security findings#2652
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main, recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Merged main and recompiled successfully in commit cd0b6be. Fixed test workflows that were using
All workflows now compile successfully:
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds strict mode enforcement for zizmor security findings, ensuring that when both --strict and --zizmor flags are enabled, any security warnings or errors detected by zizmor will cause compilation to fail rather than just being reported.
Key changes:
- Modified zizmor integration to accept a
strictparameter and treat findings as compilation errors when strict mode is enabled - Updated return signature of
parseAndDisplayZizmorOutputto return warning count for proper error reporting - Added test coverage documenting the expected strict mode behavior with zizmor
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/cli/zizmor.go | Added strict mode parameter to runZizmor() and modified error handling to fail compilation when findings exist in strict mode |
| pkg/cli/compile_command.go | Updated runZizmor() calls to pass the strict flag |
| pkg/cli/zizmor_test.go | Updated tests to handle new return signature with warning count validation |
| pkg/workflow/strict_mode.go | Added documentation explaining zizmor behavior in strict mode |
| pkg/workflow/strict_mode_zizmor_test.go | Added test documenting expected strict mode + zizmor behavior |
| pkg/cli/workflows/*.md | Removed deprecated github.actor and github.workflow expression references |
| docs/src/content/docs/reference/frontmatter-full.md | Simplified toolsets documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Agentic Changeset Generator triggered by this pull request. |
Plan: Update strict mode to treat zizmor warnings as errors ✅
Problem Statement
Update "strict" mode in compiler such that zizmor warnings/errors are not allowed and are treated as errors (if zizmor is enabled). Run recompile and report current warnings status.
Implementation Complete ✅
All changes implemented and validated:
github.actorremoval from allowed expressionsLatest Update: Merge main and fix test workflows
Merged changes from main:
github.actorandgithub.workflow)Fixed test workflows:
pkg/cli/workflows/test-all.md- Removedgithub.actorreferencespkg/cli/workflows/test-template-github-actions-syntax.md- Removedgithub.actorandgithub.workflowpkg/cli/workflows/test-template-issue-context.md- Removedgithub.actorpkg/cli/workflows/test-template-pr-context.md- Removedgithub.actorCompilation Results:
Changes Made
Modified
pkg/cli/zizmor.go:runZizmor()to accept astrict boolparameterparseAndDisplayZizmorOutput()to return the total warning count asintModified
pkg/cli/compile_command.go:runZizmor()to pass thestrictflagModified
pkg/cli/zizmor_test.go:Added
pkg/workflow/strict_mode_zizmor_test.go:Modified
pkg/workflow/strict_mode.go:Behavior Changes
Usage Example
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.