@@ -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 }}-\
@@ -97,25 +111,12 @@ jobs:
97111 path : |
98112 ${{ env.PIP_CACHE_DIR }}
99113 ${{ env.PRE_COMMIT_CACHE_DIR }}
100- ${{ env.CURL_CACHE_DIR }}
101114 ${{ steps.go-cache.outputs.dir }}
102115 restore-keys : |
103116 ${{ env.BASE_CACHE_KEY }}
104- - name : Setup curl cache
105- run : mkdir -p ${{ env.CURL_CACHE_DIR }}
106- - name : Install Packer
107- env :
108- PACKER_VERSION : ${{ steps.setup-env.outputs.packer-version }}
109- run : |
110- PACKER_ZIP="packer_${PACKER_VERSION}_linux_amd64.zip"
111- curl --output ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}" \
112- --time-cond ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}" \
113- --location \
114- "https://releases.hashicorp.com/packer/${PACKER_VERSION}/${PACKER_ZIP}"
115- sudo unzip -d /opt/packer \
116- ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}"
117- sudo mv /usr/local/bin/packer /usr/local/bin/packer-default
118- sudo ln -s /opt/packer/packer /usr/local/bin/packer
117+ - uses : hashicorp/setup-packer@v3
118+ with :
119+ version : ${{ steps.setup-env.outputs.packer-version }}
119120 - uses : hashicorp/setup-terraform@v3
120121 with :
121122 terraform_version : ${{ steps.setup-env.outputs.terraform-version }}
@@ -173,6 +174,9 @@ jobs:
173174 ${{ matrix.platform }}-${{ matrix.architecture }}
174175 needs :
175176 - diagnostics
177+ permissions :
178+ # actions/checkout needs this to fetch code
179+ contents : read
176180 runs-on : ubuntu-latest
177181 strategy :
178182 fail-fast : false
@@ -188,13 +192,21 @@ jobs:
188192 - debian13-systemd
189193 - fedora39-systemd
190194 - fedora40-systemd
195+ - fedora41-systemd
191196 - kali-systemd
192197 - ubuntu-20-systemd
193198 - ubuntu-22-systemd
194199 - ubuntu-24-systemd
195200 scenario :
196201 - default
197202 steps :
203+ # With this task in place the GitHub runners run out of
204+ # resources and crash. See cisagov/skeleton-ansible-role#211
205+ # for more details.
206+ # - uses: GitHubSecurityLab/actions-permissions/monitor@v1
207+ # with:
208+ # # Uses the organization variable unless overridden
209+ # config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
198210 - id : harden-runner
199211 name : Harden the runner
200212 uses : step-security/harden-runner@v2
@@ -207,7 +219,7 @@ jobs:
207219 uses : actions/setup-python@v5
208220 with :
209221 python-version : ${{ steps.setup-env.outputs.python-version }}
210- - uses : actions/cache@v3
222+ - uses : actions/cache@v4
211223 env :
212224 BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
213225 py${{ steps.setup-python.outputs.python-version }}-"
0 commit comments