Skip to content

Commit 3d622ba

Browse files
authored
feat: enhance Maven cache key with pom.xml hash (#650)
* feat: enhance Maven cache key with pom.xml hash Update cache key for Maven repository to include hash of pom.xml files. * chore: make checkout before cache
1 parent 56e788d commit 3d622ba

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

actions/maven-release/action.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,6 @@ runs:
108108
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1
109109
with:
110110
maven-version: ${{ inputs.maven-version }}
111-
- name: Cache local Maven repository
112-
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 #v5.0.3
113-
with:
114-
path: ~/.m2/repository
115-
key: maven-${{ runner.os }}
116-
restore-keys: |
117-
maven-${{ runner.os }}
118111
- name: Checkout
119112
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
120113
with:
@@ -123,6 +116,13 @@ runs:
123116
repository: ${{ github.repository_owner }}/${{ inputs.module }}
124117
token: ${{ inputs.token }}
125118
persist-credentials: true
119+
- name: Cache local Maven repository
120+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 #v5.0.3
121+
with:
122+
path: ~/.m2/repository
123+
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
124+
restore-keys: |
125+
maven-${{ runner.os }}-
126126
- name: Validate Maven groupId policy
127127
shell: bash
128128
run: |

0 commit comments

Comments
 (0)