You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/10/12 20:29:27 UTC

(maven-gh-actions-shared) branch v5 updated (49bf54e -> 76f0522)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch v5
in repository https://gitbox.apache.org/repos/asf/maven-gh-actions-shared.git


    from 49bf54e  Log github context on PR Signal
     new 17fef59  Cache the toolchain JDKs
     new 92e94c1  Save the setup-java caches only on the default branch
     new 6b07014  Let long-lived branches save caches through cache-save-branches
     new 76f0522  Keep saving caches on pushed branches; skip pull requests and dependabot/ branches

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/maven-verify.yml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)


(maven-gh-actions-shared) 03/04: Let long-lived branches save caches through cache-save-branches

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch v5
in repository https://gitbox.apache.org/repos/asf/maven-gh-actions-shared.git

commit 6b07014dd026d8f091ddbfac4940fbfe17b5d587
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Mon Oct 12 13:03:32 2026 +0200

    Let long-lived branches save caches through cache-save-branches
---
 .github/workflows/maven-verify.yml | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml
index 780f022..fcda5ea 100644
--- a/.github/workflows/maven-verify.yml
+++ b/.github/workflows/maven-verify.yml
@@ -220,6 +220,14 @@ on:
         default: false
         type: boolean
 
+      cache-save-branches:
+        description: >-
+          JSON array of branch names that save the Maven and JDK caches, in addition to the default branch.
+          Other branches and pull requests only restore the default branch's caches.
+        required: false
+        default: '[]'
+        type: string
+
 # allow single build per branch or PR
 concurrency:
   group: ${{ github.workflow }}-${{ github.ref }}
@@ -315,8 +323,8 @@ jobs:
           java-version: ${{ inputs.ff-jdk-toolchain }}
           distribution: ${{ inputs.ff-jdk-distribution }}
           cache-jdk: true
-          # only the default branch saves caches; other branches and pull requests restore them
-          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch }}
+          # only the default branch and cache-save-branches save caches; others restore the default branch's
+          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch && !contains(fromJSON(inputs.cache-save-branches), github.ref_name) }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up JDK
@@ -325,8 +333,8 @@ jobs:
           java-version: ${{ inputs.ff-jdk }}
           distribution: ${{ inputs.ff-jdk-distribution }}
           cache: 'maven'
-          # only the default branch saves caches; other branches and pull requests restore them
-          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch }}
+          # only the default branch and cache-save-branches save caches; others restore the default branch's
+          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch && !contains(fromJSON(inputs.cache-save-branches), github.ref_name) }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up Maven
@@ -451,8 +459,8 @@ jobs:
           java-version: ${{ inputs.jdk-toolchain }}
           distribution: ${{ matrix.distribution }}
           cache-jdk: true
-          # only the default branch saves caches; other branches and pull requests restore them
-          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch }}
+          # only the default branch and cache-save-branches save caches; others restore the default branch's
+          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch && !contains(fromJSON(inputs.cache-save-branches), github.ref_name) }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up JDK
@@ -462,8 +470,8 @@ jobs:
           java-version: ${{ matrix.jdk }}
           distribution: ${{ matrix.distribution }}
           cache: 'maven'
-          # only the default branch saves caches; other branches and pull requests restore them
-          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch }}
+          # only the default branch and cache-save-branches save caches; others restore the default branch's
+          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch && !contains(fromJSON(inputs.cache-save-branches), github.ref_name) }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up Maven


(maven-gh-actions-shared) 02/04: Save the setup-java caches only on the default branch

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch v5
in repository https://gitbox.apache.org/repos/asf/maven-gh-actions-shared.git

commit 92e94c16209bc4f04f8f81252e404569683f2be5
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Mon Oct 12 09:33:34 2026 +0000

    Save the setup-java caches only on the default branch
---
 .github/workflows/maven-verify.yml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml
index 7e2aec9..780f022 100644
--- a/.github/workflows/maven-verify.yml
+++ b/.github/workflows/maven-verify.yml
@@ -315,6 +315,8 @@ jobs:
           java-version: ${{ inputs.ff-jdk-toolchain }}
           distribution: ${{ inputs.ff-jdk-distribution }}
           cache-jdk: true
+          # only the default branch saves caches; other branches and pull requests restore them
+          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up JDK
@@ -323,6 +325,8 @@ jobs:
           java-version: ${{ inputs.ff-jdk }}
           distribution: ${{ inputs.ff-jdk-distribution }}
           cache: 'maven'
+          # only the default branch saves caches; other branches and pull requests restore them
+          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up Maven
@@ -447,6 +451,8 @@ jobs:
           java-version: ${{ inputs.jdk-toolchain }}
           distribution: ${{ matrix.distribution }}
           cache-jdk: true
+          # only the default branch saves caches; other branches and pull requests restore them
+          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up JDK
@@ -456,6 +462,8 @@ jobs:
           java-version: ${{ matrix.jdk }}
           distribution: ${{ matrix.distribution }}
           cache: 'maven'
+          # only the default branch saves caches; other branches and pull requests restore them
+          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up Maven


(maven-gh-actions-shared) 01/04: Cache the toolchain JDKs

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch v5
in repository https://gitbox.apache.org/repos/asf/maven-gh-actions-shared.git

commit 17fef594e86bbf1f717ed754f36c621e0baec7ce
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Mon Oct 12 09:25:07 2026 +0000

    Cache the toolchain JDKs
---
 .github/workflows/maven-verify.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml
index 113a616..7e2aec9 100644
--- a/.github/workflows/maven-verify.yml
+++ b/.github/workflows/maven-verify.yml
@@ -314,6 +314,7 @@ jobs:
         with:
           java-version: ${{ inputs.ff-jdk-toolchain }}
           distribution: ${{ inputs.ff-jdk-distribution }}
+          cache-jdk: true
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up JDK
@@ -445,6 +446,7 @@ jobs:
         with:
           java-version: ${{ inputs.jdk-toolchain }}
           distribution: ${{ matrix.distribution }}
+          cache-jdk: true
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up JDK


(maven-gh-actions-shared) 04/04: Keep saving caches on pushed branches; skip pull requests and dependabot/ branches

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch v5
in repository https://gitbox.apache.org/repos/asf/maven-gh-actions-shared.git

commit 76f052273aca904bc7ab5c9e5b0686549f2269ca
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Mon Oct 12 11:38:00 2026 +0000

    Keep saving caches on pushed branches; skip pull requests and dependabot/ branches
    
    Maintenance lines such as maven-4.0.x and other long-lived branches keep
    their own caches. cache-save-default-branch-only restores the stricter rule
    for projects that push topic branches to the repository.
---
 .github/workflows/maven-verify.yml | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/.github/workflows/maven-verify.yml b/.github/workflows/maven-verify.yml
index fcda5ea..8a30f92 100644
--- a/.github/workflows/maven-verify.yml
+++ b/.github/workflows/maven-verify.yml
@@ -220,13 +220,13 @@ on:
         default: false
         type: boolean
 
-      cache-save-branches:
+      cache-save-default-branch-only:
         description: >-
-          JSON array of branch names that save the Maven and JDK caches, in addition to the default branch.
-          Other branches and pull requests only restore the default branch's caches.
+          Save the Maven and JDK caches only on the default branch; other branches restore them.
+          By default every pushed branch saves except dependabot/ branches, and pull requests only restore.
         required: false
-        default: '[]'
-        type: string
+        default: false
+        type: boolean
 
 # allow single build per branch or PR
 concurrency:
@@ -323,8 +323,8 @@ jobs:
           java-version: ${{ inputs.ff-jdk-toolchain }}
           distribution: ${{ inputs.ff-jdk-distribution }}
           cache-jdk: true
-          # only the default branch and cache-save-branches save caches; others restore the default branch's
-          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch && !contains(fromJSON(inputs.cache-save-branches), github.ref_name) }}
+          # pull requests and dependabot/ branches restore caches without saving their own copies
+          cache-read-only: ${{ github.event_name == 'pull_request' || startsWith(github.ref_name, 'dependabot/') || (inputs.cache-save-default-branch-only && github.ref_name != github.event.repository.default_branch) }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up JDK
@@ -333,8 +333,8 @@ jobs:
           java-version: ${{ inputs.ff-jdk }}
           distribution: ${{ inputs.ff-jdk-distribution }}
           cache: 'maven'
-          # only the default branch and cache-save-branches save caches; others restore the default branch's
-          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch && !contains(fromJSON(inputs.cache-save-branches), github.ref_name) }}
+          # pull requests and dependabot/ branches restore caches without saving their own copies
+          cache-read-only: ${{ github.event_name == 'pull_request' || startsWith(github.ref_name, 'dependabot/') || (inputs.cache-save-default-branch-only && github.ref_name != github.event.repository.default_branch) }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up Maven
@@ -459,8 +459,8 @@ jobs:
           java-version: ${{ inputs.jdk-toolchain }}
           distribution: ${{ matrix.distribution }}
           cache-jdk: true
-          # only the default branch and cache-save-branches save caches; others restore the default branch's
-          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch && !contains(fromJSON(inputs.cache-save-branches), github.ref_name) }}
+          # pull requests and dependabot/ branches restore caches without saving their own copies
+          cache-read-only: ${{ github.event_name == 'pull_request' || startsWith(github.ref_name, 'dependabot/') || (inputs.cache-save-default-branch-only && github.ref_name != github.event.repository.default_branch) }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up JDK
@@ -470,8 +470,8 @@ jobs:
           java-version: ${{ matrix.jdk }}
           distribution: ${{ matrix.distribution }}
           cache: 'maven'
-          # only the default branch and cache-save-branches save caches; others restore the default branch's
-          cache-read-only: ${{ github.ref_name != github.event.repository.default_branch && !contains(fromJSON(inputs.cache-save-branches), github.ref_name) }}
+          # pull requests and dependabot/ branches restore caches without saving their own copies
+          cache-read-only: ${{ github.event_name == 'pull_request' || startsWith(github.ref_name, 'dependabot/') || (inputs.cache-save-default-branch-only && github.ref_name != github.event.repository.default_branch) }}
           show-download-progress: ${{ inputs.show-download-progress }}
 
       - name: Set up Maven