github-security-report 0.26.0__tar.gz → 0.28.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. {github_security_report-0.26.0 → github_security_report-0.28.0}/PKG-INFO +167 -55
  2. {github_security_report-0.26.0 → github_security_report-0.28.0}/README.md +165 -53
  3. {github_security_report-0.26.0 → github_security_report-0.28.0}/pyproject.toml +2 -2
  4. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/_version.py +2 -2
  5. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/classify.py +5 -3
  6. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/__init__.py +6 -0
  7. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/app.py +24 -28
  8. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/boundary.py +50 -8
  9. github_security_report-0.28.0/src/github_security_report/cli/guard.py +125 -0
  10. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/modes.py +40 -6
  11. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/outputs.py +7 -4
  12. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/preflight.py +86 -87
  13. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/preflight_messages.py +31 -12
  14. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/remediation.py +4 -2
  15. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/serialise.py +3 -0
  16. github_security_report-0.28.0/src/github_security_report/cli/token_scopes.py +223 -0
  17. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/__init__.py +2 -0
  18. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/alerts.py +12 -5
  19. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/batch_errors.py +2 -2
  20. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/errors.py +47 -0
  21. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/failures.py +78 -2
  22. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/repo_parser.py +8 -0
  23. github_security_report-0.28.0/src/github_security_report/client/retry.py +57 -0
  24. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/transport.py +30 -42
  25. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/writes.py +53 -7
  26. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/workflow_runs.py +1 -0
  27. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/config/blocks.py +1 -0
  28. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/config/key_notes.py +3 -0
  29. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/config/schema.py +5 -0
  30. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/config/workflow_runs.py +3 -0
  31. github_security_report-0.28.0/src/github_security_report/contribution_refs.py +109 -0
  32. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/layout.py +2 -2
  33. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/models.py +41 -97
  34. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/remediate/__init__.py +76 -12
  35. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/remediate/model.py +6 -2
  36. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/render/html.py +1 -1
  37. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/render/markdown.py +2 -2
  38. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/render/slack.py +5 -4
  39. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/render/terminal.py +1 -101
  40. github_security_report-0.28.0/src/github_security_report/render/terminal_remediation.py +137 -0
  41. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/report/aggregate.py +2 -1
  42. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/report/signals.py +29 -2
  43. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/report/tables.py +18 -0
  44. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/runner.py +61 -24
  45. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/summary.py +25 -1
  46. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/workflow_runs/tables.py +42 -5
  47. {github_security_report-0.26.0 → github_security_report-0.28.0}/.gitignore +0 -0
  48. {github_security_report-0.26.0 → github_security_report-0.28.0}/LICENSE +0 -0
  49. {github_security_report-0.26.0 → github_security_report-0.28.0}/LICENSES/Apache-2.0.txt +0 -0
  50. {github_security_report-0.26.0 → github_security_report-0.28.0}/scripts/README.md +0 -0
  51. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/__init__.py +0 -0
  52. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/authors.py +0 -0
  53. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/categories/__init__.py +0 -0
  54. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/categories/keys.py +0 -0
  55. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/categories/signals.py +0 -0
  56. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/categories/tables.py +0 -0
  57. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/__main__.py +0 -0
  58. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/config_cmd.py +0 -0
  59. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/config_source.py +0 -0
  60. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/options.py +0 -0
  61. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/progress.py +0 -0
  62. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/publish.py +0 -0
  63. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/cli/summary.py +0 -0
  64. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/accounting.py +0 -0
  65. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/analyses.py +0 -0
  66. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/bodies.py +0 -0
  67. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/codeql_parsers.py +0 -0
  68. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/copilot.py +0 -0
  69. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/endpoints.py +0 -0
  70. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/events.py +0 -0
  71. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/org_reads.py +0 -0
  72. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/paging.py +0 -0
  73. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/parsers.py +0 -0
  74. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/queries.py +0 -0
  75. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/reads.py +0 -0
  76. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/reviews.py +0 -0
  77. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/client/workflow_runs.py +0 -0
  78. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/code_quality.py +0 -0
  79. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/codeql/__init__.py +0 -0
  80. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/codeql/cleanup.py +0 -0
  81. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/codeql/facts.py +0 -0
  82. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/codeql/tables.py +0 -0
  83. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/__init__.py +0 -0
  84. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/codeql.py +0 -0
  85. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/context.py +0 -0
  86. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/exclusions.py +0 -0
  87. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/extras.py +0 -0
  88. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/graph.py +0 -0
  89. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/org.py +0 -0
  90. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/protocols.py +0 -0
  91. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/repo.py +0 -0
  92. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/run_sync.py +0 -0
  93. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/collect/scoping.py +0 -0
  94. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/config/__init__.py +0 -0
  95. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/config/dictionary.py +0 -0
  96. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/config/errors.py +0 -0
  97. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/config/loader.py +0 -0
  98. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/config/models.py +0 -0
  99. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/config/order.py +0 -0
  100. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/fuzz.py +0 -0
  101. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/gating.py +0 -0
  102. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/gitctx.py +0 -0
  103. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/issue_presentation.py +0 -0
  104. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/issues.py +0 -0
  105. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/malware.py +0 -0
  106. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/matching.py +0 -0
  107. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/ordering.py +0 -0
  108. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/posture/__init__.py +0 -0
  109. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/posture/enablement.py +0 -0
  110. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/posture/facts.py +0 -0
  111. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/posture/quality.py +0 -0
  112. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/posture/releases.py +0 -0
  113. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/pulls/__init__.py +0 -0
  114. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/pulls/columns.py +0 -0
  115. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/pulls/counting.py +0 -0
  116. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/pulls/presentation.py +0 -0
  117. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/pulls/table.py +0 -0
  118. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/py.typed +0 -0
  119. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/ranking.py +0 -0
  120. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/remediate/codeql.py +0 -0
  121. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/render/__init__.py +0 -0
  122. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/render/slack_limits.py +0 -0
  123. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/render/slack_text.py +0 -0
  124. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/render/terminal_notices.py +0 -0
  125. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/report/__init__.py +0 -0
  126. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/report/display.py +0 -0
  127. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/report/exclusions.py +0 -0
  128. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/rulesets.py +0 -0
  129. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/scope.py +0 -0
  130. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/secret_patterns.py +0 -0
  131. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/severity.py +0 -0
  132. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/templates/index.html.j2 +0 -0
  133. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/templates/report.html.j2 +0 -0
  134. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/workflow_runs/__init__.py +0 -0
  135. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/workflow_runs/aggregate.py +0 -0
  136. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/workflow_runs/models.py +0 -0
  137. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/workflow_runs/store.py +0 -0
  138. {github_security_report-0.26.0 → github_security_report-0.28.0}/src/github_security_report/workflow_runs/store_codec.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: github-security-report
3
- Version: 0.26.0
3
+ Version: 0.28.0
4
4
  Summary: Security and quality reporting across GitHub organisations
5
5
  Project-URL: Homepage, https://github.com/lfreleng-actions/github-security-report-action
6
6
  Project-URL: Repository, https://github.com/lfreleng-actions/github-security-report-action
@@ -37,7 +37,7 @@ Requires-Dist: pytest-cov==7.1.0; extra == 'dev'
37
37
  Requires-Dist: pytest==9.2.0; extra == 'dev'
38
38
  Requires-Dist: respx==0.23.1; extra == 'dev'
39
39
  Requires-Dist: ruff==0.17.5; extra == 'dev'
40
- Requires-Dist: syrupy==7.0.1; extra == 'dev'
40
+ Requires-Dist: syrupy==7.0.2; extra == 'dev'
41
41
  Requires-Dist: types-jsonschema==4.26.0.20261006; extra == 'dev'
42
42
  Requires-Dist: types-pyyaml==6.0.12.20250915; extra == 'dev'
43
43
  Description-Content-Type: text/markdown
@@ -72,7 +72,15 @@ states and rendered worst-first:
72
72
  - **Clean** — enabled with zero findings (a count beneath the table).
73
73
  - **Not enabled** — supported but switched off (a counted "disabled" footer
74
74
  line, with the affected repositories named).
75
- - **Unknown** — indeterminate (insufficient permission), counted separately.
75
+ - **Unknown** — indeterminate, counted separately. The terminal, Markdown
76
+ and HTML reports name the reasons beside the count, for example
77
+ `3 Unknown (2 insufficient permission, 1 alert data incomplete)`:
78
+ - `insufficient permission` — the token cannot read the signal (`403`).
79
+ - `indeterminate` — a read that settles enablement failed.
80
+ - `alert data unavailable` — the alert read failed with nothing collected.
81
+ - `alert data incomplete` — the alert read failed part-way.
82
+ - `languages unreadable` — fuzzing could not read the languages.
83
+ - `no reason recorded` — the classifier gave none.
76
84
 
77
85
  Every category renders the same **standardised summary footer** beneath its
78
86
  table: remediation-first count lines (failures, disabled, unknown, then the
@@ -223,6 +231,9 @@ tables (org mode):
223
231
  ones), **Retried** (runs that passed on a later attempt, a direct sign of
224
232
  flakiness), **Workflows** (how many distinct workflows failed) and **Worst
225
233
  workflow** (the one with the most failures, linked to its run history).
234
+ A display threshold, `workflow_runs.fail_rate_display_threshold`, can
235
+ hide the rows failing at or below a given rate; they still count in the
236
+ footer.
226
237
  Slack draws the same fixed-width table narrowed to **Repository**,
227
238
  **Failed**, **Runs** and **Fail %**, with its totals row and footer; the
228
239
  other columns stay on the terminal, GitHub Pages and `report.json`.
@@ -291,8 +302,8 @@ token (default `GITHUB_TOKEN`): its rate limit, and its read of every
291
302
  organisation's listing. For a classic PAT the same check warns about a missing
292
303
  scope from the table below and about a token that expires within seven days.
293
304
  The rate-limit, scope and expiry checks are best effort: when `GET /rate_limit`
294
- times out, fails to connect, answers anything but `200` or `401`, or sends a
295
- body the tool cannot read, they are skipped for that token (logged at DEBUG)
305
+ times out, fails to connect, answers anything but `200`, `401` or a refusal
306
+ for a spent rate limit, or sends a body the tool cannot read, they are skipped for that token (logged at DEBUG)
296
307
  and the run goes on to the listing checks. A passing pre-flight therefore does
297
308
  not prove that every token's budget was checked.
298
309
 
@@ -379,14 +390,17 @@ signal readable: repo mode reads the alerts only after a GraphQL read
379
390
  the job token can make that read has not been tested. Where it cannot, the
380
391
  Dependabot signal reads as unknown when the response carries no repository,
381
392
  but as **disabled** when it carries the repository without that field's value
382
- (see the Dependabot bullet below); neither fails the gate.
393
+ (see the Dependabot bullet below). A disabled signal never fails the gate; an
394
+ unknown one fails it only with `fail_on_unknown` on.
383
395
 
384
396
  No job permission covers secret-scanning alerts: GitHub serves them only to a
385
397
  GitHub App or a personal access token, and `security-events` covers code
386
398
  scanning. With the job token, secret scanning therefore never gates a pull
387
- request; it reads as unknown or disabled. To gate on leaked secrets, pass a
388
- token that can read them through the action's `token` input, and grant it
389
- the repository permissions for every signal repo mode reads (see the
399
+ request on leaked secrets; it reads as unknown or disabled. An unknown reading
400
+ fails the gate under `fail_on_unknown`, so leave that input off for a job that
401
+ runs with the job token. To gate on leaked secrets, pass a token that can read
402
+ them through the action's `token` input, and grant it the repository
403
+ permissions for every signal repo mode reads (see the
390
404
  [fine-grained table](#single-organisation--fine-grained-pat)). GitHub also
391
405
  requires the account behind a personal access token to be an administrator
392
406
  of the repository or of its organisation; otherwise the read is refused
@@ -398,15 +412,16 @@ the default `none`.
398
412
 
399
413
  On a `pull_request` run from a fork, GitHub withholds repository secrets by
400
414
  default, so a token passed from `secrets` is empty and the action falls back
401
- to the job token: secret scanning then does not gate that run, and the job
402
- can pass. A workflow that must not pass without the token should fail in an
403
- earlier step when the secret is empty. Do not switch to `pull_request_target`
404
- to obtain the secret: a job that then checks out the pull request's code
405
- exposes the token to it. For the same reason, do not enable a private or
406
- internal repository's **Send secrets to workflows from pull requests**
407
- setting where untrusted contributors can open fork pull requests: with it on,
408
- the token is passed to workflow code the fork controls instead of falling
409
- back to the job token.
415
+ to the job token: secret scanning then does not gate that run on leaked
416
+ secrets, and the job can pass unless `fail_on_unknown` is on and the read
417
+ comes back unknown. A workflow that must not pass without the token should
418
+ fail in an earlier step when the secret is empty. Do not switch to
419
+ `pull_request_target` to obtain the secret: a job that then checks out the
420
+ pull request's code exposes the token to it. For the same reason, do not
421
+ enable a private or internal repository's **Send secrets to workflows from
422
+ pull requests** setting where untrusted contributors can open fork pull
423
+ requests: with it on, the token is passed to workflow code the fork controls
424
+ instead of falling back to the job token.
410
425
 
411
426
  Repo mode reads the repository's code-scanning, secret-scanning and Dependabot
412
427
  alerts. A read the token cannot make does not always surface as unknown. A
@@ -421,16 +436,16 @@ read as not enabled rather than unknown.
421
436
  analyses answers with invalid JSON or a non-array body, each is unknown,
422
437
  except one a ruleset enforces, whose alert read is then skipped so that it
423
438
  reads as clean. A `404` reads as code scanning **disabled**, and a tool missing from
424
- the analyses reads **not enabled**, as it does when its filtered probe fails
425
- with an HTTP error.
439
+ the analyses reads **not enabled**, unless its filtered probe fails with an
440
+ HTTP error, which leaves it **unknown** as well.
426
441
  Neither applies to a tool a ruleset enforces: it counts as enabled, and
427
442
  after a `404` its alert read is skipped, so it reads as clean rather than
428
443
  disabled. For a tool detected in the analyses or enforced by a ruleset,
429
444
  an alert at or above the category's cutoff makes the repository an
430
445
  offender even when the alert read did not finish; otherwise an unfinished
431
- alert read is **unknown**, never clean. A tool left undetected, such as by
432
- a failed probe, reads **not enabled** whatever alerts were collected, so
433
- its alerts do not fail the gate.
446
+ alert read is **unknown**, never clean. A tool left undetected reads **not
447
+ enabled**, or **unknown** when its probe failed, whatever alerts were
448
+ collected, so its alerts do not fail the gate.
434
449
  - Scorecard prefers its external score from scorecard.dev, read without the
435
450
  token, so it can be classified, clean included, while the analyses are
436
451
  unreadable. Without that score it falls back to its code-scanning alerts
@@ -458,15 +473,34 @@ Repo mode classifies every category against its default cutoff (see
458
473
  [Pass/fail severity cutoff](#passfail-severity-cutoff)) and ignores
459
474
  `report.categories.<key>.fail_severity`. CodeQL, Scorecard findings and
460
475
  Dependabot use `medium`, aislop `low` and zizmor `informational`, so a
461
- repository whose only CodeQL alerts are `low` reads clean and passes even at
462
- `fail_threshold` `any` or `low`.
463
-
464
- Classification and the gate are separate, and the gate acts only on offenders.
465
- `fail_threshold: any` fails the job on every offender, a sub-10 Scorecard
466
- score with no findings included. A severity threshold fails it only on an
467
- offender with a finding at or above that severity. An unknown or disabled
468
- signal never fails the gate, so a token missing a permission can pass it:
469
- check each category's footer for its `❓` unknown count.
476
+ repository whose only CodeQL alerts are `low` reads clean. The gate still
477
+ weighs those alerts: they fail it at `fail_threshold` `any` or `low`.
478
+
479
+ Classification and the gate are separate, and the gate judges findings rather
480
+ than offenders. A severity threshold fails the job when any signal holds an
481
+ open finding at or above it, whatever the signal's state: a clean signal with
482
+ findings under its category's cutoff, or an unknown one with the alerts it
483
+ read before the read failed. `fail_threshold: any` fails the job on every
484
+ offender, a sub-10 Scorecard score with no findings included, and on any open
485
+ finding of any severity; `none` never fails on findings. With the default
486
+ cutoffs only `low` and `any` reach findings that are not already offenders.
487
+
488
+ A signal that could not be read fails the gate only with `fail_on_unknown`
489
+ (`--fail-on-unknown`) on; it does so at any `fail_threshold`, `none`
490
+ included. The flag covers the signals the gate reads (CodeQL, Scorecard,
491
+ zizmor, aislop, fuzz, Dependabot alerts and secret scanning): a disabled or
492
+ not-applicable signal never fails it, nor does the unknown count of a table
493
+ such as Workflow Failures. Without the flag a token missing a permission can
494
+ pass the gate: check each category's footer for its `❓` unknown count. A
495
+ failed gate prints one line per cause: the signals holding findings at or
496
+ above the threshold, and each unreadable signal with the reason it could not
497
+ be read.
498
+
499
+ > The flag and input are recent additions. The action passes the flag only
500
+ > when the input is `"true"`, so leaving it off cannot break a run; but outside
501
+ > pull requests the action runs the pinned release, and a release predating the
502
+ > flag rejects it with `No such option`. Turn the input on only once the pinned
503
+ > release supports it, or set `tool_version` to one that does.
470
504
 
471
505
  Repo mode reads no issues, pull requests or organisation membership, so it
472
506
  needs no permission for them.
@@ -594,6 +628,17 @@ every write, provided the token's account holds the access described above.
594
628
  `admin:org` stays optional, exactly as for the report, except as
595
629
  the `codeql` caveat below describes.
596
630
 
631
+ The pre-flight checks a classic PAT's scopes against these writes: an
632
+ `--apply` whose token holds neither `repo` nor `public_repo` stops with exit
633
+ code `2` before anything is collected, naming the token and the missing scope,
634
+ and one holding `public_repo` alone warns that private repositories cannot be
635
+ changed. `codeql_stale_configurations` deletes code scanning analyses, which
636
+ `security_events` also permits, but its workflow re-enables need `repo` or
637
+ `public_repo`, so with that scope alone the category can still write and the
638
+ warning names its re-enables. An apply stops only when no selected category
639
+ can write, and otherwise warns naming the categories that cannot. A
640
+ fine-grained PAT or App token reports no scopes, so this check skips it.
641
+
597
642
  **Fine-grained PAT, reads:** the repository permissions Metadata, Contents,
598
643
  Dependabot alerts, Code scanning alerts, Secret scanning alerts, Issues,
599
644
  Administration and Actions from the report's table. Keep Issues: a failed issue
@@ -615,9 +660,9 @@ maps to `codeql` covers it. The analysis check reads analyses on every branch,
615
660
  not only the default branch, so a repository whose only CodeQL analysis came
616
661
  from a feature branch reads as enabled and is not a target, though its default
617
662
  branch has none. The check reads the newest 100 analyses, and when CodeQL is
618
- not among them, a probe filtered to CodeQL; if that probe fails with an HTTP
619
- error, CodeQL goes undetected for the run, so a repository whose CodeQL
620
- analyses are all older becomes a target. Any other CodeQL pipeline that has
663
+ not among them, a probe filtered to CodeQL; if that probe fails, CodeQL reads
664
+ as unknown for the run, so the repository is not a target whether or not it
665
+ has older CodeQL analyses. Any other CodeQL pipeline that has
621
666
  not yet uploaded an analysis leaves the repository a `codeql` target: a
622
667
  repository-local workflow, a required workflow the mapping does not name, one
623
668
  whose ruleset the token cannot read, or an external pipeline that uploads with
@@ -708,6 +753,8 @@ that only shape an organisation-wide run — `output_dir`, `pages_url`,
708
753
  — are **rejected** with exit code 2 rather than accepted and discarded, so a
709
754
  misconfigured workflow says so instead of quietly producing a report that
710
755
  ignores them.
756
+ `fail_on_unknown` is refused the same way in org mode, which has no gate for
757
+ it to act on.
711
758
 
712
759
  ### Runtime isolation
713
760
 
@@ -918,7 +965,9 @@ rest stay short — set it to `0` for no limit at all:
918
965
  Here Releases / Tagging lists every repository, CodeQL shows its worst three, and
919
966
  every other category keeps the shared limit of 10. A category's `top_n` applies
920
967
  to all four surfaces at once; combine it with `top_n_report` / `top_n_cli` /
921
- `top_n_slack` to vary the fallback per surface.
968
+ `top_n_slack` to vary the fallback per surface. On the Workflow Failures
969
+ tables, `workflow_runs.fail_rate_display_threshold` applies first: the limit,
970
+ and its `… and N more` tally, count only the rows the threshold leaves.
922
971
 
923
972
  The resolution order for one category on one surface, most specific first:
924
973
 
@@ -1890,9 +1939,11 @@ flight when the first failure arrives were issued at the old size, so on a
1890
1939
  slow day up to four oversized batches, rather than one, may fail before the
1891
1940
  smaller size takes effect; that bounded cost buys the overlap. Only a
1892
1941
  single-repository query GitHub still cannot answer, or a failure that a
1893
- smaller query could not fix (a `403`, an exhausted rate limit, or a
1894
- `500`/`503` outage rather than a `502`/`504` timeout), aborts the run with
1895
- exit code `3`, and the queries still in flight are cancelled first.
1942
+ smaller query could not fix (a `403` or a `500`/`503` outage rather than a
1943
+ `502`/`504` timeout), aborts the run with exit code `3`, and the queries
1944
+ still in flight are cancelled first. An exhausted GraphQL rate limit is not
1945
+ retried smaller either: it aborts the run with exit code `6` (see
1946
+ [Exit codes](#exit-codes)).
1896
1947
 
1897
1948
  The value can be set three ways, in this order of precedence:
1898
1949
 
@@ -2003,6 +2054,7 @@ like every other `report` key. Every key with its default:
2003
2054
  "persistent_threshold": 0.9,
2004
2055
  "min_runs": 3,
2005
2056
  "fail_rate_error_threshold": 0.05,
2057
+ "fail_rate_display_threshold": 0,
2006
2058
  "cache": true
2007
2059
  }
2008
2060
  },
@@ -2051,6 +2103,23 @@ Markdown, HTML and Slack carry no cell colour, so the setting leaves them
2051
2103
  unchanged. It is independent of `persistent_threshold`, which judges
2052
2104
  single workflows.
2053
2105
 
2106
+ `fail_rate_display_threshold`, a number from `0` to `1`, hides the rows
2107
+ failing at or below that fraction of their pass-or-fail runs, so a busy
2108
+ organisation's handful of high failure rates is not lost among repositories
2109
+ failing one run in a hundred. A row is listed only when its rate is strictly
2110
+ above the threshold, the comparison `fail_rate_error_threshold` makes. Each
2111
+ table judges the rate in its own **Fail %** column: the per-repository table
2112
+ the repository's rate, the detail table the workflow's, so a workflow
2113
+ failing often stays listed when its repository as a whole falls below the
2114
+ threshold. The comparison uses the unrounded rate, not the percentage the
2115
+ cell shows: with `0.02`, a repository failing 2.4% of its runs reads `2%`
2116
+ and is listed, and one failing 1.6% also reads `2%` and is not. Every
2117
+ surface applies it, for every window. The footer's counts do not change,
2118
+ since a hidden repository still has failures, and a footer line says how
2119
+ many rows the threshold hides (`22 failing at or below 2% not listed`);
2120
+ when it hides every row, the table is not drawn and the footer still is.
2121
+ `report.json` keeps every row. The default `0` lists every failing row.
2122
+
2054
2123
  `cache` and `cache_dir` govern the **run store**, a SQLite file per
2055
2124
  organisation at
2056
2125
 
@@ -2250,6 +2319,7 @@ github-security-report config keys report.categories.code_quality
2250
2319
  | `top_n_cli` | No | — | Offenders per signal in the terminal output (`0` = no limit; overrides `top_n`) |
2251
2320
  | `top_n_slack` | No | — | Offenders per signal in the Slack digest (`0` = no limit; overrides `top_n`) |
2252
2321
  | `fail_threshold` | No | `none` | `none`/`low`/`medium`/`high`/`critical`/`any` (repo mode) |
2322
+ | `fail_on_unknown` | No | `false` | Also fail the repo-mode gate when a signal could not be read (repo mode only; refused with exit code `2` in org mode). Passed to the CLI only when `"true"`; a pinned release predating the flag rejects it |
2253
2323
  | `force_notify` | No | `false` | Post to Slack regardless of `report_day` |
2254
2324
  | `hide` | No | `""` | Category keys to suppress on every output (space- or comma-separated). Overrides config, and is one-way: it cannot re-enable a disabled category |
2255
2325
  | `graph_batch` | No | `""` | Repositories per batched GraphQL prefetch query (minimum `1`; default: config, else `10`). Pass a repository or organisation variable such as `${{ vars.GSR_GRAPH_BATCH }}` to adjust it from settings. A batch that still fails is halved automatically, so this sets the starting size (see [GraphQL prefetch batch size](#graphql-prefetch-batch-size)) |
@@ -2270,7 +2340,7 @@ github-security-report config keys report.categories.code_quality
2270
2340
  | ---- | ----------- |
2271
2341
  | `should_notify` | Whether today is a Slack notification day |
2272
2342
  | `slack_payload` | Prebuilt Slack `chat.postMessage` payload (JSON) |
2273
- | `failed` | Whether the repo-mode fail threshold was met |
2343
+ | `failed` | Whether the repo-mode gate failed (exit code `1`) |
2274
2344
 
2275
2345
  ## Running locally
2276
2346
 
@@ -2354,19 +2424,37 @@ API in the same way.
2354
2424
  | Code | Meaning |
2355
2425
  | ---- | ------- |
2356
2426
  | `0` | The report ran. |
2357
- | `1` | Repo mode only: findings met or exceeded `--fail-threshold`. |
2427
+ | `1` | Repo mode: the gate failed on findings or `--fail-on-unknown`. |
2358
2428
  | `2` | Usage or configuration error (bad flag, bad config, unset token). |
2359
2429
  | `3` | The GitHub API was unusable after the retry budget (see below). |
2360
2430
  | `4` | GitHub rejected the credentials (HTTP 401). |
2361
2431
  | `5` | A repository listing answered `403` or `404`, with no rate limit. |
2362
- | `6` | A token's rate limit stopped the pre-flight (causes below). |
2432
+ | `6` | A rate limit with nothing left stopped the run (causes below). |
2433
+ | `7` | Internal error: an unexpected failure, not a finding (see below). |
2363
2434
 
2364
- Code `6` has three causes, and a rate-limited `403` is one of them, not `5`:
2435
+ Code `6` has five causes, and a rate-limited `403` is one of them, not `5`:
2365
2436
 
2366
2437
  - a core or GraphQL budget already spent when the run started;
2367
2438
  - a rate-limited listing, including a `403` whose message names a secondary
2368
2439
  rate limit;
2369
- - a listing page that spent the last request.
2440
+ - a listing page that spent the last request;
2441
+ - a read refused mid-run because the primary budget is spent (a `403` or
2442
+ `429` with `x-ratelimit-remaining: 0`) and the reset is further away than
2443
+ the retry budget allows;
2444
+ - a GraphQL prefetch refused because a GraphQL rate limit is spent.
2445
+
2446
+ A read refused mid-run waits for the reset, and retries, only when the
2447
+ later of `x-ratelimit-reset` and any `Retry-After`, plus a second, fits in
2448
+ what is left of that request's retry budget. Otherwise the run stops at
2449
+ once: retrying on the ordinary schedule cannot outlast the reset, and
2450
+ GitHub warns that continuing to send requests while rate limited may get an
2451
+ integration banned. With no `x-ratelimit-reset`, the read is retried on the
2452
+ ordinary schedule and the run stops when that is spent. The message names
2453
+ the rate-limit resource, the endpoint, and when the budget resets in UTC
2454
+ with the minutes to wait. A secondary rate limit (no
2455
+ `x-ratelimit-remaining: 0`) that outlives the retry budget still degrades
2456
+ that one read to unknown, and a `remediate` write refused for a spent budget
2457
+ still reports that target's failure rather than stopping the run.
2370
2458
 
2371
2459
  Codes `3` to `6` are **aborts, not reports**: nothing is written and no Pages
2372
2460
  artifact is produced. That is deliberate. A token that has expired, been revoked
@@ -2379,11 +2467,20 @@ cannot read, or a rate limit with nothing left, would produce the same report,
2379
2467
  so they stop the run too.
2380
2468
 
2381
2469
  For `remediate`, "nothing is written" holds only when the pre-flight stops the
2382
- run (any `5` or `6`, and a `3` or `4` raised before collection starts). After
2383
- the pre-flight passes, `remediate` collects and writes one organisation at a
2384
- time, so a `3` or `4` from a later organisation comes after the earlier ones'
2385
- writes have been applied. Check what the run printed before re-running; a
2386
- re-run enables only what it finds still off.
2470
+ run (any `5`, a `6` from the pre-flight, and a `3` or `4` raised before
2471
+ collection starts). After the pre-flight passes, `remediate` collects and
2472
+ writes one organisation at a time, so a `3`, `4` or `6` from a later
2473
+ organisation comes after the earlier ones' writes have been applied. Check
2474
+ what the run printed before re-running; a re-run enables only what it finds
2475
+ still off.
2476
+
2477
+ Code `7` is not an abort. It reports an error the tool did not expect: a
2478
+ defect, or a failure no specific check covers, such as an `--output-dir` that
2479
+ cannot be created. Unlike `3` to `6`, it can come after output was written,
2480
+ so files under `--output-dir` may be partial; do not publish them, and treat
2481
+ the run as failed. For `remediate`, changes made before the error stand, as
2482
+ above. The message names the error in one line; re-run with `--verbose` to
2483
+ print the traceback, which never includes local variables.
2387
2484
 
2388
2485
  Org-mode `report` and `remediate` check for these before they collect
2389
2486
  anything, for every configured organisation before the first. `report` reads
@@ -2395,7 +2492,8 @@ budget (exit `6`, naming the resource and when it resets); and one
2395
2492
  single-repository page of each organisation's listing finds a `403` or `404`
2396
2493
  (exit `5`). The `/rate_limit` probe is best effort: it is made once with a
2397
2494
  short timeout, and when it times out, cannot connect, answers anything but
2398
- `200` or `401`, or sends an unreadable body, its budget, scope and expiry
2495
+ `200`, `401` or a refusal for a spent rate limit (exit `6`), or sends an
2496
+ unreadable body, its budget, scope and expiry
2399
2497
  checks are skipped for that token (logged at DEBUG) and the run carries on.
2400
2498
  The code `5` message names the organisation and what to check:
2401
2499
  its name, a classic PAT's SSO authorisation for it, or a fine-grained PAT's
@@ -2407,16 +2505,16 @@ advises waiting at least a minute. One that still fails after the retry
2407
2505
  budget, or whose page holds an entry that is not a repository, exits `3`. A
2408
2506
  token GitHub rejects exits `4`, and the message says which token. A run that
2409
2507
  passes prints nothing new. A listing whose *later* page fails mid-run still
2410
- produces a report marked incomplete.
2508
+ produces a report marked incomplete, unless a spent rate limit refused it
2509
+ (exit `6`).
2411
2510
 
2412
2511
  Code `3` covers a GitHub API that could not be reached at all, and a GraphQL
2413
2512
  prefetch that failed as a whole: either a size-shaped failure (`502`/`504`
2414
2513
  timeout, `200` with no data, resource limits exceeded) that persisted even
2415
2514
  after the batch had been halved down to one repository, or a failure that
2416
- halving could not have fixed (`403`, an exhausted GraphQL rate limit, a
2417
- `500`/`503` outage), which aborts at once. The message reports the status or
2418
- cause and ends with the matching next step — a smaller `--graph-batch`, retry
2419
- later, wait for the rate-limit budget to reset, or check the token's
2515
+ halving could not have fixed (`403`, a `500`/`503` outage), which aborts at
2516
+ once. The message reports the status or cause and ends with the matching
2517
+ next step — a smaller `--graph-batch`, retry later, or check the token's
2420
2518
  permissions — so read it rather than assuming "retry later" (see
2421
2519
  [GraphQL prefetch batch size](#graphql-prefetch-batch-size)).
2422
2520
 
@@ -2440,6 +2538,20 @@ read-only `token_env` in the config.
2440
2538
  [The `remediate` subcommand](#the-remediate-subcommand) under Token permissions
2441
2539
  lists the scopes and permissions it needs, by category.
2442
2540
 
2541
+ Before it collects anything, a dry run warns when a classic PAT could not make
2542
+ the changes it previews: one without `repo` or `public_repo` could make none of
2543
+ them (bar the CodeQL cleanup's deletions, which `security_events` also
2544
+ permits), and one with `public_repo` alone cannot change private repositories.
2545
+ Beneath each category's preview, it also names the targets whose repository
2546
+ the token's account does not administer, since GitHub may refuse those writes;
2547
+ they stay in the preview and its counts, and `--apply` still attempts them.
2548
+ During `--apply`, once three writes in a row in one category are refused with
2549
+ the same `403` or `404` answer, that category writes nothing more in that
2550
+ organisation: its remaining targets are reported as skipped, naming the
2551
+ refusal, and count as neither changed nor failed. A write that succeeds in
2552
+ between, even one step of a target's several, ends the run. The next category,
2553
+ and the next organisation, start afresh.
2554
+
2443
2555
  ```bash
2444
2556
  # Token scopes and permissions: see "The remediate subcommand" under
2445
2557
  # Token permissions.