From 57f4ea3bc164710bc1cd5e0f780787a44de8d71a Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sat, 24 Oct 2026 16:30:29 +0200 Subject: [PATCH] Save caches only from the default branch and .x lines Every push saved the Maven cache and, through setup-java 6's default, each installed JDK into its own branch scope, where no other build reads it. --- .github/workflows/maven-verify.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml index 88dc78402..7a5773b1c 100644 --- a/.github/workflows/maven-verify.yml +++ b/.github/workflows/maven-verify.yml @@ -47,6 +47,9 @@ jobs: java-version: ${{ matrix.java }} distribution: 'temurin' cache: 'maven' + cache-jdk: false + # only pushes to the default branch and .x lines save; other branches and pull requests restore + cache-read-only: ${{ !(github.event_name == 'push' && (github.ref_name == github.event.repository.default_branch || endsWith(github.ref_name, '.x'))) }} - name: Set up Maven run: mvn --errors --batch-mode --show-version wrapper:wrapper "-Dtype=only-script" "-Dmaven=3.9.7"