From 77f6b99a4ca345147264ef574b62bf8d397606db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Wa=C5=9B?= Date: Thu, 3 Nov 2022 14:36:47 +0100 Subject: [PATCH] Restore Maven cache from default branch Allow to use cache from the default branch even when there are changes in any pom files. --- checkout-and-setup/action.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/checkout-and-setup/action.yml b/checkout-and-setup/action.yml index fef0b36..13b6762 100644 --- a/checkout-and-setup/action.yml +++ b/checkout-and-setup/action.yml @@ -44,7 +44,15 @@ runs: with: distribution: 'zulu' java-version: ${{ inputs.java-version }} - cache: ${{ inputs.cache }} + - name: Cache local Maven repo + id: cache + if: ${{ inputs.cache == 'maven' }} + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: Configure Problem Matchers if: ${{ inputs.java-version != '' }} shell: bash