Skip to content

Commit efb39f2

Browse files
Fix cache overwriting JFrog settings.xml with expired tokens
The actions/cache step was restoring ~/.m2 (including settings.xml from a previous run with an expired OIDC token) after the composite action generated a fresh settings.xml. This caused 401 errors on subsequent runs. Fix by: 1. Caching only ~/.m2/repository (artifacts only, not settings.xml) 2. Moving cache restore before the build environment setup
1 parent 69ab795 commit efb39f2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/push.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ jobs:
2020
- name: Checkout
2121
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
2222

23-
- name: Setup build environment
24-
uses: ./.github/actions/setup-build-environment
25-
with:
26-
java-version: 11
27-
2823
- name: Cache Maven packages
2924
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
3025
with:
31-
path: ~/.m2
26+
path: ~/.m2/repository
3227
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
3328
restore-keys: ${{ runner.os }}-m2
3429

30+
- name: Setup build environment
31+
uses: ./.github/actions/setup-build-environment
32+
with:
33+
java-version: 11
34+
3535
- name: Check formatting
3636
run: mvn --errors spotless:check
3737

@@ -60,18 +60,18 @@ jobs:
6060
- name: Checkout
6161
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
6262

63-
- name: Setup build environment
64-
uses: ./.github/actions/setup-build-environment
65-
with:
66-
java-version: ${{ matrix.java-version }}
67-
6863
- name: Cache Maven packages
6964
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
7065
with:
71-
path: ~/.m2
66+
path: ~/.m2/repository
7267
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
7368
restore-keys: ${{ runner.os }}-m2
7469

70+
- name: Setup build environment
71+
uses: ./.github/actions/setup-build-environment
72+
with:
73+
java-version: ${{ matrix.java-version }}
74+
7575
- name: Check Unit Tests
7676
run: mvn --errors test
7777

0 commit comments

Comments
 (0)