Skip to content

Commit 4d1ffe9

Browse files
committed
Try to utilize cache in releases where possible
1 parent ffcc7b0 commit 4d1ffe9

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ permissions:
1111
contents: write
1212
pull-requests: write
1313

14+
# DO NOT RESTORE CACHE for critical release steps to prevent a (extremely unlikely) scenario
15+
# where a supply chain attack could be achieved due to poisoned cache
1416
jobs:
1517
check-code:
1618
runs-on: ubuntu-latest
@@ -23,7 +25,15 @@ jobs:
2325
with:
2426
java-version: '17'
2527
distribution: 'temurin'
26-
cache: 'maven'
28+
29+
# Try to reuse existing cache from check-build
30+
- name: Try restore Maven Cache
31+
uses: actions/cache/restore@v4
32+
with:
33+
path: ~/.m2/repository
34+
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
35+
restore-keys: |
36+
${{ runner.os }}-mvn-build-
2737
2838
- name: Build with Maven
2939
run: ./mvnw -B clean package -T2C
@@ -168,6 +178,15 @@ jobs:
168178
distribution: 'temurin'
169179
cache: 'maven'
170180

181+
# Try to reuse existing cache from check-build
182+
- name: Try restore Maven Cache
183+
uses: actions/cache/restore@v4
184+
with:
185+
path: ~/.m2/repository
186+
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
187+
restore-keys: |
188+
${{ runner.os }}-mvn-build-
189+
171190
- name: Build site
172191
run: ../mvnw -B compile site -DskipTests -T2C
173192
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}

0 commit comments

Comments
 (0)