Skip to content

Commit ccdc279

Browse files
authored
ci, action: address zizmor findings, bump versions (#222)
Signed-off-by: William Woodruff <william@yossarian.net>
1 parent 709f8a4 commit ccdc279

File tree

7 files changed

+56
-50
lines changed

7 files changed

+56
-50
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ on:
66
- main
77
pull_request:
88

9+
permissions: {}
10+
911
jobs:
1012
lint:
1113
runs-on: ubuntu-latest
1214
steps:
13-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
15+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1416
with:
1517
persist-credentials: false
1618

.github/workflows/release.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ on:
55

66
name: release
77

8-
permissions:
9-
# Used to sign the release's artifacts with sigstore-python.
10-
id-token: write
11-
12-
# Used to attach signing artifacts to the published release.
13-
contents: write
8+
permissions: {}
149

1510
jobs:
1611
release:
1712
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write # Used to sign the artifacts.
15+
contents: write # Used to attach signing artifacts to the release.
16+
1817
steps:
19-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
18+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2019
with:
2120
persist-credentials: false
2221

.github/workflows/schedule-selftest.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@ name: Scheduled self-test
22

33
on:
44
schedule:
5-
- cron: '0 12 * * *' # Every day at 1200 UTC
5+
- cron: "0 12 * * *" # Every day at 1200 UTC
6+
7+
permissions: {}
68

79
jobs:
810
run-selftests:
911
permissions:
10-
id-token: write
12+
id-token: write # for OIDC in selftest
1113

1214
uses: ./.github/workflows/selftest.yml
1315
open-issue:
1416
permissions:
15-
issues: write
17+
issues: write # for opening the issue
1618

1719
runs-on: ubuntu-latest
1820
if: ${{ failure() }}

.github/workflows/selftest.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions: {}
1313
jobs:
1414
selftest:
1515
permissions:
16-
id-token: write
16+
id-token: write # selftest
1717
strategy:
1818
matrix:
1919
os:
@@ -25,10 +25,10 @@ jobs:
2525
runs-on: ${{ matrix.os }}
2626
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
2727
steps:
28-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
28+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2929
with:
3030
persist-credentials: false
31-
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
31+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
3232
if: ${{ matrix.os != 'ubuntu-latest' }}
3333
with:
3434
python-version: "3.x"
@@ -45,7 +45,7 @@ jobs:
4545
4646
selftest-runner-python:
4747
permissions:
48-
id-token: write
48+
id-token: write # selftest
4949
strategy:
5050
matrix:
5151
os:
@@ -55,7 +55,7 @@ jobs:
5555
runs-on: ${{ matrix.os }}
5656
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
5757
steps:
58-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
58+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
5959
with:
6060
persist-credentials: false
6161
- name: Sign artifact and publish signature
@@ -71,7 +71,7 @@ jobs:
7171
7272
selftest-whitespace:
7373
permissions:
74-
id-token: write
74+
id-token: write # selftest
7575
strategy:
7676
matrix:
7777
os:
@@ -81,10 +81,10 @@ jobs:
8181
runs-on: ${{ matrix.os }}
8282
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
8383
steps:
84-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
84+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8585
with:
8686
persist-credentials: false
87-
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
87+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
8888
if: ${{ matrix.os != 'ubuntu-latest' }}
8989
with:
9090
python-version: "3.x"
@@ -106,7 +106,7 @@ jobs:
106106
107107
selftest-xfail-invalid-inputs:
108108
permissions:
109-
id-token: write
109+
id-token: write # selftest
110110
runs-on: ubuntu-latest
111111
strategy:
112112
matrix:
@@ -117,7 +117,7 @@ jobs:
117117
- "/tmp/extremely-nonexistent-file"
118118
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
119119
steps:
120-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
120+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
121121
with:
122122
persist-credentials: false
123123
- name: Sign artifact and publish signature
@@ -138,11 +138,11 @@ jobs:
138138
139139
selftest-staging:
140140
permissions:
141-
id-token: write
141+
id-token: write # selftest
142142
runs-on: ubuntu-latest
143143
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
144144
steps:
145-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
145+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
146146
with:
147147
persist-credentials: false
148148
- name: Sign artifact and publish signature
@@ -158,11 +158,11 @@ jobs:
158158
159159
selftest-glob:
160160
permissions:
161-
id-token: write
161+
id-token: write # selftest
162162
runs-on: ubuntu-latest
163163
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
164164
steps:
165-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
165+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
166166
with:
167167
persist-credentials: false
168168
- name: Sign artifacts and publish signatures
@@ -180,13 +180,13 @@ jobs:
180180
181181
selftest-xfail-glob-input-expansion:
182182
permissions:
183-
id-token: write
183+
id-token: write # selftest
184184
runs-on: ubuntu-latest
185185
env:
186186
TEST_DIR: test
187187
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
188188
steps:
189-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
189+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
190190
with:
191191
persist-credentials: false
192192
- name: Sign artifacts and publish signatures
@@ -210,11 +210,11 @@ jobs:
210210
211211
selftest-glob-multiple:
212212
permissions:
213-
id-token: write
213+
id-token: write # selftest
214214
runs-on: ubuntu-latest
215215
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
216216
steps:
217-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
217+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
218218
with:
219219
persist-credentials: false
220220
- name: Sign artifacts and publish signatures
@@ -237,11 +237,11 @@ jobs:
237237
238238
selftest-upload-artifacts:
239239
permissions:
240-
id-token: write
240+
id-token: write # selftest
241241
runs-on: ubuntu-latest
242242
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
243243
steps:
244-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
244+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
245245
with:
246246
persist-credentials: false
247247
- name: Sign artifact and publish signature
@@ -252,7 +252,7 @@ jobs:
252252
staging: true
253253
upload-signing-artifacts: true
254254
internal-be-careful-debug: true
255-
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v4
255+
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
256256
with:
257257
name: "signing-artifacts-${{ github.job }}"
258258
path: ./test/uploaded
@@ -264,11 +264,11 @@ jobs:
264264

265265
selftest-verify:
266266
permissions:
267-
id-token: write
267+
id-token: write # selftest
268268
runs-on: ubuntu-latest
269269
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
270270
steps:
271-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
271+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
272272
with:
273273
persist-credentials: false
274274
- name: Sign artifact and publish signature
@@ -284,7 +284,7 @@ jobs:
284284

285285
selftest-xfail-verify-missing-options:
286286
permissions:
287-
id-token: write
287+
id-token: write # selftest
288288
runs-on: ubuntu-latest
289289
strategy:
290290
matrix:
@@ -308,7 +308,7 @@ jobs:
308308

309309
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
310310
steps:
311-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
311+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
312312
with:
313313
persist-credentials: false
314314
- name: Sign artifact and publish signature
@@ -334,11 +334,11 @@ jobs:
334334
335335
selftest-identity-token:
336336
permissions:
337-
id-token: write
337+
id-token: write # selftest
338338
runs-on: ubuntu-latest
339339
if: (github.event_name != 'pull_request') || !github.event.pull_request.head.repo.fork
340340
steps:
341-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
341+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
342342
with:
343343
persist-credentials: false
344344
- name: Get OIDC token

.github/workflows/semgrep.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,28 @@ on:
22
pull_request: {}
33
push:
44
branches:
5-
- main
6-
- master
5+
- main
6+
- master
77
paths:
8-
- .github/workflows/semgrep.yml
8+
- .github/workflows/semgrep.yml
99
schedule:
10-
- cron: '0 0 * * 0'
10+
- cron: "0 0 * * 0"
11+
12+
permissions: {}
13+
1114
name: Semgrep
15+
1216
jobs:
1317
semgrep:
1418
name: Scan
1519
runs-on: ubuntu-latest
1620
env:
1721
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
1822
container:
19-
image: semgrep/semgrep
23+
image: semgrep/semgrep:1.138.0
2024

2125
steps:
22-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
26+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2327
with:
2428
persist-credentials: false
2529
- run: semgrep ci

.github/workflows/zizmor.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ on:
66
pull_request:
77
branches: ["**"]
88

9+
permissions: {}
10+
911
jobs:
1012
zizmor:
1113
name: zizmor latest via PyPI
1214
runs-on: ubuntu-latest
1315
permissions:
14-
security-events: write
15-
# required for workflows in private repositories
16-
contents: read
17-
actions: read
16+
security-events: write # for uploading the sarif file
1817
steps:
1918
- name: Checkout repository
20-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
19+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2120
with:
2221
persist-credentials: false
2322

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ runs:
101101
GHA_SIGSTORE_PYTHON_INPUTS: "${{ inputs.inputs }}"
102102
shell: bash
103103

104-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
104+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
105105
if: inputs.upload-signing-artifacts == 'true'
106106
with:
107107
name: "signing-artifacts-${{ github.job }}"

0 commit comments

Comments
 (0)