Skip to content

Commit f6c6c9e

Browse files
dopeyclaude
andauthored
Auto-enable zizmor GHAS upload for public repos (#298)
* ci: auto-enable zizmor GHAS upload for public repos Move advanced-security auto-detection into zizmor.yml so any caller benefits. Changes the input type from boolean to string (default "") to distinguish "not set" from "false". When unset, enables GHAS upload for public repos via github.repository_visibility; explicit "true"/"false" overrides still work via boolean coercion. Co-Authored-By: Claude <noreply@anthropic.com> * ci: replace direct workflow calls with actionci in ci.yml Replace the three separate actionlint, zizmor, and frizbee jobs with a single actionci job that delegates to actionci.yml. Add security-events: write permission so actionci.yml can propagate it to the zizmor job for SARIF upload on this public repo. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 549b83b commit f6c6c9e

3 files changed

Lines changed: 12 additions & 18 deletions

File tree

.github/workflows/actionci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ on:
1414
type: boolean
1515
default: true
1616
zizmor-advanced-security:
17-
description: Upload zizmor results to GitHub Advanced Security
17+
description: Upload zizmor results to GitHub Advanced Security. Leave unset to auto-enable for public repos, or set to "true"/"false" to override.
1818
required: false
19-
type: boolean
20-
default: false
19+
type: string
20+
default: ""
2121

2222
permissions:
2323
contents: read

.github/workflows/ci.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,11 @@ concurrency:
1919
cancel-in-progress: true
2020

2121
jobs:
22-
actionlint:
23-
name: Lint GitHub workflows
24-
uses: ./.github/workflows/actionlint.yml
25-
26-
zizmor:
27-
name: Scan GitHub workflows
28-
uses: ./.github/workflows/zizmor.yml
29-
30-
frizbee:
31-
name: Check action pinning
32-
uses: ./.github/workflows/frizbee.yml
22+
actionci:
23+
uses: ./.github/workflows/actionci.yml
24+
permissions:
25+
contents: read
26+
security-events: write
3327

3428
lint-dummy-app: # NOTE(@azazeal): this check is here to verify that .golangci.yml is valid
3529
name: Lint dummy app

.github/workflows/zizmor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ on:
33
workflow_call:
44
inputs:
55
advanced-security:
6-
description: Upload results to GitHub Advanced Security
7-
type: boolean
8-
default: false
6+
description: Upload results to GitHub Advanced Security. Leave unset to auto-enable for public repos, or set to "true"/"false" to override.
7+
type: string
8+
default: ""
99

1010
jobs:
1111
zizmor:
@@ -20,4 +20,4 @@ jobs:
2020
with:
2121
min-severity: medium
2222
min-confidence: medium
23-
advanced-security: ${{ inputs.advanced-security }}
23+
advanced-security: ${{ (inputs.advanced-security == '' && github.repository_visibility == 'public') || inputs.advanced-security == 'true' }}

0 commit comments

Comments
 (0)