@@ -21,7 +21,6 @@ defaults:
2121
2222env :
2323 AWS_DEFAULT_REGION : us-east-1
24- CURL_CACHE_DIR : ~/.cache/curl
2524 PIP_CACHE_DIR : ~/.cache/pip
2625 PRE_COMMIT_CACHE_DIR : ~/.cache/pre-commit
2726 RUN_TMATE : ${{ secrets.RUN_TMATE }}
3231jobs :
3332 diagnostics :
3433 name : Run diagnostics
34+ # This job does not need any permissions
35+ permissions : {}
3536 runs-on : ubuntu-latest
3637 steps :
3738 # Note that a duplicate of this step must be added at the top of
3839 # each job.
40+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
41+ with :
42+ # Uses the organization variable unless overridden
43+ config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
44+ # Note that a duplicate of this step must be added at the top of
45+ # each job.
3946 - id : harden-runner
4047 name : Harden the runner
4148 uses : step-security/harden-runner@v2
5057 lint :
5158 needs :
5259 - diagnostics
60+ permissions :
61+ # actions/checkout needs this to fetch code
62+ contents : read
5363 runs-on : ubuntu-latest
5464 steps :
65+ - uses : GitHubSecurityLab/actions-permissions/monitor@v1
66+ with :
67+ # Uses the organization variable unless overridden
68+ config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
5569 - id : harden-runner
5670 name : Harden the runner
5771 uses : step-security/harden-runner@v2
7791 name : Lookup Go cache directory
7892 run : |
7993 echo "dir=$(go env GOCACHE)" >> $GITHUB_OUTPUT
80- - uses : actions/cache@v3
94+ - uses : actions/cache@v4
8195 env :
8296 BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
8397 py${{ steps.setup-python.outputs.python-version }}-\
@@ -98,25 +112,12 @@ jobs:
98112 path : |
99113 ${{ env.PIP_CACHE_DIR }}
100114 ${{ env.PRE_COMMIT_CACHE_DIR }}
101- ${{ env.CURL_CACHE_DIR }}
102115 ${{ steps.go-cache.outputs.dir }}
103116 restore-keys : |
104117 ${{ env.BASE_CACHE_KEY }}
105- - name : Setup curl cache
106- run : mkdir -p ${{ env.CURL_CACHE_DIR }}
107- - name : Install Packer
108- env :
109- PACKER_VERSION : ${{ steps.setup-env.outputs.packer-version }}
110- run : |
111- PACKER_ZIP="packer_${PACKER_VERSION}_linux_amd64.zip"
112- curl --output ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}" \
113- --time-cond ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}" \
114- --location \
115- "https://releases.hashicorp.com/packer/${PACKER_VERSION}/${PACKER_ZIP}"
116- sudo unzip -d /opt/packer \
117- ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}"
118- sudo mv /usr/local/bin/packer /usr/local/bin/packer-default
119- sudo ln -s /opt/packer/packer /usr/local/bin/packer
118+ - uses : hashicorp/setup-packer@v3
119+ with :
120+ version : ${{ steps.setup-env.outputs.packer-version }}
120121 - uses : hashicorp/setup-terraform@v3
121122 with :
122123 terraform_version : ${{ steps.setup-env.outputs.terraform-version }}
@@ -174,6 +175,9 @@ jobs:
174175 ${{ matrix.platform }}-${{ matrix.architecture }}
175176 needs :
176177 - diagnostics
178+ permissions :
179+ # actions/checkout needs this to fetch code
180+ contents : read
177181 runs-on : ubuntu-latest
178182 strategy :
179183 fail-fast : false
@@ -189,13 +193,21 @@ jobs:
189193 - debian13-systemd
190194 - fedora39-systemd
191195 - fedora40-systemd
196+ - fedora41-systemd
192197 - kali-systemd
193198 - ubuntu-20-systemd
194199 - ubuntu-22-systemd
195200 - ubuntu-24-systemd
196201 scenario :
197202 - default
198203 steps :
204+ # With this task in place the GitHub runners run out of
205+ # resources and crash. See cisagov/skeleton-ansible-role#211
206+ # for more details.
207+ # - uses: GitHubSecurityLab/actions-permissions/monitor@v1
208+ # with:
209+ # # Uses the organization variable unless overridden
210+ # config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
199211 - id : harden-runner
200212 name : Harden the runner
201213 uses : step-security/harden-runner@v2
@@ -208,7 +220,7 @@ jobs:
208220 uses : actions/setup-python@v5
209221 with :
210222 python-version : ${{ steps.setup-env.outputs.python-version }}
211- - uses : actions/cache@v3
223+ - uses : actions/cache@v4
212224 env :
213225 BASE_CACHE_KEY : " ${{ github.job }}-${{ runner.os }}-\
214226 py${{ steps.setup-python.outputs.python-version }}-"
0 commit comments