@@ -20,7 +20,6 @@ defaults:
2020 shell : bash -Eueo pipefail -x {0}
2121
2222env :
23- CURL_CACHE_DIR : ~/.cache/curl
2423 PIP_CACHE_DIR : ~/.cache/pip
2524 PRE_COMMIT_CACHE_DIR : ~/.cache/pre-commit
2625 RUN_TMATE : ${{ secrets.RUN_TMATE }}
3130jobs :
3231 diagnostics :
3332 name : Run diagnostics
33+ # This job does not need any permissions
34+ permissions : {}
3435 runs-on : ubuntu-latest
3536 steps :
3637 # Note that a duplicate of this step must be added at the top of
3738 # each job.
39+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
40+ with :
41+ # Uses the organization variable unless overridden
42+ config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
43+ # Note that a duplicate of this step must be added at the top of
44+ # each job.
3845 - id : harden-runner
3946 name : Harden the runner
4047 uses : step-security/harden-runner@v2
4956 lint :
5057 needs :
5158 - diagnostics
59+ permissions :
60+ # actions/checkout needs this to fetch code
61+ contents : read
5262 runs-on : ubuntu-latest
5363 steps :
64+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
65+ with :
66+ # Uses the organization variable unless overridden
67+ config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
5468 - id : harden-runner
5569 name : Harden the runner
5670 uses : step-security/harden-runner@v2
7690 name : Lookup Go cache directory
7791 run : |
7892 echo "dir=$(go env GOCACHE)" >> $GITHUB_OUTPUT
79- - uses : actions/cache@v3
93+ - uses : actions/cache@v4
8094 env :
8195 BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
8296 py${{ steps.setup-python.outputs.python-version }}-\
@@ -101,25 +115,12 @@ jobs:
101115 path : |
102116 ${{ env.PIP_CACHE_DIR }}
103117 ${{ env.PRE_COMMIT_CACHE_DIR }}
104- ${{ env.CURL_CACHE_DIR }}
105118 ${{ steps.go-cache.outputs.dir }}
106119 restore-keys : |
107120 ${{ env.BASE_CACHE_KEY }}
108- - name : Setup curl cache
109- run : mkdir -p ${{ env.CURL_CACHE_DIR }}
110- - name : Install Packer
111- env :
112- PACKER_VERSION : ${{ steps.setup-env.outputs.packer-version }}
113- run : |
114- PACKER_ZIP="packer_${PACKER_VERSION}_linux_amd64.zip"
115- curl --output ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}" \
116- --time-cond ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}" \
117- --location \
118- "https://releases.hashicorp.com/packer/${PACKER_VERSION}/${PACKER_ZIP}"
119- sudo unzip -d /opt/packer \
120- ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}"
121- sudo mv /usr/local/bin/packer /usr/local/bin/packer-default
122- sudo ln -s /opt/packer/packer /usr/local/bin/packer
121+ - uses : hashicorp/setup-packer@v3
122+ with :
123+ version : ${{ steps.setup-env.outputs.packer-version }}
123124 - uses : hashicorp/setup-terraform@v3
124125 with :
125126 terraform_version : ${{ steps.setup-env.outputs.terraform-version }}
@@ -175,18 +176,30 @@ jobs:
175176 name : test source - py${{ matrix.python-version }}
176177 needs :
177178 - diagnostics
178- runs-on : ubuntu-latest
179+ permissions :
180+ # actions/checkout needs this to fetch code
181+ contents : read
182+ runs-on : ${{ matrix.os }}
179183 strategy :
180184 fail-fast : false
181185 matrix :
186+ include :
187+ - os : ubuntu-22.04
188+ python-version : " 3.7"
189+ os :
190+ - ubuntu-latest
182191 python-version :
183- - " 3.7"
184192 - " 3.8"
185193 - " 3.9"
186194 - " 3.10"
187195 - " 3.11"
188196 - " 3.12"
197+ - " 3.13"
189198 steps :
199+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
200+ with :
201+ # Uses the organization variable unless overridden
202+ config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
190203 - id : harden-runner
191204 name : Harden the runner
192205 uses : step-security/harden-runner@v2
@@ -197,7 +210,7 @@ jobs:
197210 uses : actions/setup-python@v5
198211 with :
199212 python-version : ${{ matrix.python-version }}
200- - uses : actions/cache@v3
213+ - uses : actions/cache@v4
201214 env :
202215 BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
203216 py${{ steps.setup-python.outputs.python-version }}-"
@@ -232,11 +245,18 @@ jobs:
232245 uses : mxschmitt/action-tmate@v3
233246 if : env.RUN_TMATE
234247 coveralls-finish :
248+ permissions :
249+ # actions/checkout needs this to fetch code
250+ contents : read
235251 runs-on : ubuntu-latest
236252 needs :
237253 - diagnostics
238254 - test
239255 steps :
256+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
257+ with :
258+ # Uses the organization variable unless overridden
259+ config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
240260 - id : harden-runner
241261 name : Harden the runner
242262 uses : step-security/harden-runner@v2
@@ -249,7 +269,7 @@ jobs:
249269 uses : actions/setup-python@v5
250270 with :
251271 python-version : ${{ steps.setup-env.outputs.python-version }}
252- - uses : actions/cache@v3
272+ - uses : actions/cache@v4
253273 env :
254274 BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
255275 py${{ steps.setup-python.outputs.python-version }}-"
@@ -281,18 +301,30 @@ jobs:
281301 - diagnostics
282302 - lint
283303 - test
284- runs-on : ubuntu-latest
304+ permissions :
305+ # actions/checkout needs this to fetch code
306+ contents : read
307+ runs-on : ${{ matrix.os }}
285308 strategy :
286309 fail-fast : false
287310 matrix :
311+ include :
312+ - os : ubuntu-22.04
313+ python-version : " 3.7"
314+ os :
315+ - ubuntu-latest
288316 python-version :
289- - " 3.7"
290317 - " 3.8"
291318 - " 3.9"
292319 - " 3.10"
293320 - " 3.11"
294321 - " 3.12"
322+ - " 3.13"
295323 steps :
324+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
325+ with :
326+ # Uses the organization variable unless overridden
327+ config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
296328 - id : harden-runner
297329 name : Harden the runner
298330 uses : step-security/harden-runner@v2
@@ -303,7 +335,7 @@ jobs:
303335 uses : actions/setup-python@v5
304336 with :
305337 python-version : ${{ matrix.python-version }}
306- - uses : actions/cache@v3
338+ - uses : actions/cache@v4
307339 env :
308340 BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
309341 py${{ steps.setup-python.outputs.python-version }}-"
@@ -336,18 +368,30 @@ jobs:
336368 needs :
337369 - diagnostics
338370 - build
339- runs-on : ubuntu-latest
371+ permissions :
372+ # actions/checkout needs this to fetch code
373+ contents : read
374+ runs-on : ${{ matrix.os }}
340375 strategy :
341376 fail-fast : false
342377 matrix :
378+ include :
379+ - os : ubuntu-22.04
380+ python-version : " 3.7"
381+ os :
382+ - ubuntu-latest
343383 python-version :
344- - " 3.7"
345384 - " 3.8"
346385 - " 3.9"
347386 - " 3.10"
348387 - " 3.11"
349388 - " 3.12"
389+ - " 3.13"
350390 steps :
391+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
392+ with :
393+ # Uses the organization variable unless overridden
394+ config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
351395 - id : harden-runner
352396 name : Harden the runner
353397 uses : step-security/harden-runner@v2
@@ -358,7 +402,7 @@ jobs:
358402 uses : actions/setup-python@v5
359403 with :
360404 python-version : ${{ matrix.python-version }}
361- - uses : actions/cache@v3
405+ - uses : actions/cache@v4
362406 env :
363407 BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
364408 py${{ steps.setup-python.outputs.python-version }}-"
0 commit comments