ci: save workflow cache only on main branch pushes - #341
Merged
PiotrKorkus merged 1 commit intoSep 14, 2026
Merged
Conversation
srinivasugithub
requested review from
AlexanderLanin,
FScholPer,
MaximilianSoerenPollak,
PiotrKorkus,
antonkri,
dcalavrezo-qorix,
lurtz,
nradakovic,
opajonk and
pawelrutkaq
as code owners
September 12, 2026 09:36
|
The created documentation from the pull request is available at: docu-html |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The referenced setup-bazel versions ignore cache-save, so non-main runs can still save caches.
Pull request overview
This PR aims to restrict Bazel cache writes to pushes on main.
Changes:
- Adds main-branch conditions to cache-saving configuration.
- Applies the policy across all listed Bazel workflows.
File summaries
| File | Reviewed change |
|---|---|
.github/workflows/test_and_docs.yml |
Adds a main-branch cache-save condition; the configured action does not consume it. |
.github/workflows/reusable_integration-build.yml |
Adds the condition, but setup-bazel@0.15.0 does not support cache-save. |
.github/workflows/check_release_approvals.yml |
Adds a main-branch cache-save condition; the configured action does not consume it. |
.github/workflows/build_and_test_qnx.yml |
Adds a main-branch cache-save condition; the configured action does not consume it. |
.github/workflows/build_and_test_linux.yml |
Adds a main-branch cache-save condition; the configured action does not consume it. |
.github/workflows/build_and_test_ebclfsa.yml |
Adds a main-branch cache-save condition; the configured action does not consume it. |
.github/workflows/build_and_test_autosd.yml |
Adds a main-branch cache-save condition; the configured action does not consume it. |
Review details
Suppressed comments (7)
.github/workflows/build_and_test_autosd.yml:51
setup-bazel@0.18.0does not declare or consumecache-save; its post action invokes cache saving unconditionally. This expression is therefore ignored, so a cache miss on a pull-request or merge-group run can still save the Bazel caches. Use an action revision that supportscache-save(or another supported save-control mechanism) before relying on this condition.
cache-save: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
.github/workflows/build_and_test_ebclfsa.yml:43
setup-bazel@0.18.0does not declare or consumecache-save; its post action invokes cache saving unconditionally. This expression is therefore ignored, so a cache miss on a pull-request or merge-group run can still save the Bazel caches. Use an action revision that supportscache-save(or another supported save-control mechanism) before relying on this condition.
cache-save: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
.github/workflows/build_and_test_linux.yml:44
setup-bazel@0.18.0does not declare or consumecache-save; its post action invokes cache saving unconditionally. This expression is therefore ignored, so a cache miss on a pull-request run can still save the Bazel caches. Use an action revision that supportscache-save(or another supported save-control mechanism) before relying on this condition.
cache-save: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
.github/workflows/build_and_test_qnx.yml:48
setup-bazel@0.18.0does not declare or consumecache-save; its post action invokes cache saving unconditionally. This expression is therefore ignored, so a cache miss on a pull-request or merge-group run can still save the Bazel caches. Use an action revision that supportscache-save(or another supported save-control mechanism) before relying on this condition.
cache-save: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
.github/workflows/check_release_approvals.yml:34
setup-bazel@0.18.0does not declare or consumecache-save; its post action invokes cache saving unconditionally. This expression is therefore ignored, so a cache miss on a pull-request review run can still save the Bazel caches. Use an action revision that supportscache-save(or another supported save-control mechanism) before relying on this condition.
cache-save: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
.github/workflows/reusable_integration-build.yml:113
setup-bazel@0.15.0does not define thecache-saveinput; its post step always saves enabled caches, so this condition is ignored and the reusable integration workflow can still write caches for PRs/feature pushes. Please upgrade this action to a version that supportscache-save(for example the0.18.0used by the other workflows).
cache-save: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
.github/workflows/test_and_docs.yml:52
setup-bazel@0.18.0does not declare or consumecache-save; its post action invokes cache saving unconditionally. This expression is therefore ignored, so a cache miss on a pull-request run can still save the Bazel caches. Use an action revision that supportscache-save(or another supported save-control mechanism) before relying on this condition.
cache-save: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
PiotrKorkus
approved these changes
Sep 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR optimizes the workflow caching behavior to save the build and repository caches only on the 'main' branch pushes, and never on Pull Requests (PRs) or feature branches. Resolves #130.