From d6e06fc13910b2d01e78c5d2f413d79eba7c7930 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sat, 24 Oct 2026 16:28:42 +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 b42a76669..a2f137086 100644 --- a/.github/workflows/maven-verify.yml +++ b/.github/workflows/maven-verify.yml @@ -52,6 +52,9 @@ jobs: java-version: ${{ matrix.java }} distribution: 'zulu' 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 org.apache.maven.plugins:maven-wrapper-plugin:3.3.4:wrapper "-Dmaven=3.9.12"