Skip to content

Commit e3a59c9

Browse files
authored
Upload workflow security scan results (#50)
Also address zizmor workflow warnings
1 parent 230161e commit e3a59c9

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

.github/workflows/cla.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
name: "CLA Assistant"
22

3+
# NOTE: This workflow runs against PR *target* branches, not against the source branches.
4+
# This ensures modified code cannot be executed with the workflow's permissions.
5+
# It's still easier to misuse than most potential triggers, hence the zizmor warning.
6+
37
on:
48
issue_comment:
59
types: [created]
6-
pull_request_target:
10+
pull_request_target: # zizmor: ignore[dangerous-triggers]
711
types: [opened, closed, synchronize, labeled] # Added "labeled" event to check for label changes
812
workflow_dispatch: # Allow manual triggering of the workflow
913

1014
permissions:
1115
actions: write
12-
contents: write
16+
contents: read # Signatures are stored in a dedicated repository
1317
pull-requests: write
1418
statuses: write
1519
checks: write

.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
release:
55
types: [published]
66

7+
# Require explicit job permissions
8+
permissions: {}
79

810
jobs:
911
pypi-publish:

.github/workflows/scan-workflows.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ on:
1111
branches:
1212
- main
1313

14+
# Require explicit job permissions
15+
permissions: {}
16+
1417
jobs:
1518
zizmor:
1619
name: zizmor latest via PyPI
1720
runs-on: ubuntu-latest
1821
permissions:
1922
security-events: write
20-
# required for workflows in private repositories
21-
contents: read
22-
actions: read
2323
steps:
2424
- name: Checkout repository
2525
uses: actions/checkout@v4
@@ -34,9 +34,8 @@ jobs:
3434
env:
3535
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3636

37-
# TODO: upload results once the repository is public
38-
# - name: Upload SARIF file
39-
# uses: github/codeql-action/upload-sarif@v3
40-
# with:
41-
# sarif_file: results.sarif
42-
# category: zizmor
37+
- name: Upload SARIF file
38+
uses: github/codeql-action/upload-sarif@v3
39+
with:
40+
sarif_file: results.sarif
41+
category: zizmor

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ on:
2424
branches:
2525
- main
2626

27+
# Require explicit job permissions
28+
permissions: {}
29+
2730
defaults:
2831
run:
2932
# Use the Git for Windows bash shell, rather than supporting Powershell

0 commit comments

Comments
 (0)