Skip to content

ci: save workflow cache only on main branch pushes - #341

Merged
PiotrKorkus merged 1 commit into
eclipse-score:mainfrom
bgsw-contrib:feature/cache-save-only-main
Sep 14, 2026
Merged

PiotrKorkus merged 1 commit into
eclipse-score:mainfrom
bgsw-contrib:feature/cache-save-only-main

Conversation

@srinivasugithub

Copy link
Copy Markdown
Contributor

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.

@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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.0 does not declare or consume cache-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 supports cache-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.0 does not declare or consume cache-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 supports cache-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.0 does not declare or consume cache-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 supports cache-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.0 does not declare or consume cache-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 supports cache-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.0 does not declare or consume cache-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 supports cache-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.0 does not define the cache-save input; 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 supports cache-save (for example the 0.18.0 used 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.0 does not declare or consume cache-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 supports cache-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
PiotrKorkus merged commit 9f573f5 into eclipse-score:main Sep 14, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ref_int - cache improvements

4 participants