Skip to content

Commit da5ac40

Browse files
authored
README: add a troubleshooting section about Advanced Security (#51)
1 parent cc28a58 commit da5ac40

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,42 @@ Linux-based runner that comes with Docker by default. You _may_ be
296296
able to use [docker/setup-docker-action] to install Docker on other runners,
297297
but this is **not officially supported** by this action.
298298

299+
### Changes introduce security alerts but no PR checks are shown
300+
301+
> [!NOTE]
302+
> This is **not** a bug in `zizmor-action` or `zizmor`. It's a quirk of
303+
> GitHub's handling of SARIF in their Advanced Security feature.
304+
305+
As reported in [#43], GitHub's "Advanced Security" integration is somewhat
306+
fickle about when it decides to show checks on PRs for code scanning
307+
alerts.
308+
309+
GitHub's criteria for displaying a check on a PR is documented
310+
under [SARIF support for code scanning] and
311+
[Triaging code scanning alerts in pull requests]. The short version is that the
312+
check will **not** be shown **unless all lines** in the finding are included
313+
in the PR's diff. This is unintuitive (since findings typically carry context
314+
that extends beyond the changed lines), but it's how GitHub behaves.
315+
316+
If you hit this behavior, you have a few options:
317+
318+
1. Continue to use `zizmor-action` with `advanced-security: true`,
319+
but configure a [ruleset] to prevent PRs from merging until all
320+
code scanning alerts are resolved. This is the recommended approach,
321+
but you **must** configure it manually — `zizmor-action` cannot do
322+
it for you.
323+
2. Set `advanced-security: false` and use another output format, like
324+
[annotations](#annotations) or the default ("plain") console format
325+
(which you get by default when you set `advanced-security: false`).
326+
With either of these approaches you lose the stateful tracking and triage
327+
of Advanced Security, but you'll also avoid this issue.
328+
329+
If you choose to switch to annotations, please keep in mind
330+
that annotations also come with significant limitations, including a hard
331+
limit of 10 annotations per workflow run. See the documentation above for
332+
more details.
333+
334+
299335
[`zizmor`]: https://docs.zizmor.sh
300336
[Advanced Security]: https://docs.github.com/en/get-started/learning-about-github/about-github-advanced-security
301337
[About code scanning alerts - Pull request check failures for code scanning alerts]: https://docs.github.com/en/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#pull-request-check-failures-for-code-scanning-alerts
@@ -304,6 +340,10 @@ but this is **not officially supported** by this action.
304340
[Using personas]: https://docs.zizmor.sh/usage/#using-personas
305341
[Filtering results]: https://docs.zizmor.sh/usage/#filtering-results
306342
[docker/setup-docker-action]: https://github.com/docker/setup-docker-action
343+
[#43]: https://github.com/zizmorcore/zizmor-action/issues/43
344+
[SARIF support for code scanning]: https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#specifying-the-location-for-source-files
345+
[Triaging code scanning alerts in pull requests]: https://docs.github.com/en/code-security/code-scanning/managing-code-scanning-alerts/triaging-code-scanning-alerts-in-pull-requests?utm_source=chatgpt.com#about-code-scanning-results-on-pull-requests
346+
[ruleset]: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#set-code-scanning-merge-protection
307347

308348
## License
309349

0 commit comments

Comments
 (0)