slachiewicz commented on code in PR #339:
URL:
https://github.com/apache/maven-gh-actions-shared/pull/339#discussion_r4247727381
##########
.github/workflows/maven-verify.yml:
##########
@@ -314,6 +314,9 @@ jobs:
with:
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 }}
Review Comment:
@slawekjaranowski done in 10020a1: `cache-read-only` is now set only for
pull requests and `dependabot/` branches, so `maven-4.0.x`, the `-3.x` lines
and other pushed branches keep saving their own caches. The `dependabot/` part
is needed because Dependabot pushes its branches into the repository, so each
also builds on push and would save its own copy.
apache/maven itself does not use this workflow: its `maven-3.10.x`,
`maven-3.9.x` and `maven-4.0.x` lines have their own `maven.yml`, which runs on
every pushed branch and saves the IT repository cache unconditionally. That is
where its 9.3 GB of Dependabot caches come from. It needs the same rule in
those files: push builds only for the branch itself, and caches saved only on
push.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]