8000 Add new setting save-on-success. by helly25 · Pull Request #1571 · actions/cache · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add new setting save-on-success. #1571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

helly25
Copy link
@helly25 helly25 commented Mar 11, 2025

Proposal to implement #1570, https://github.com/actions/cache/discussions/1598

Description

Allows to control whether new caches can be written in post action on success.

Motivation and Context

In some cases you want to read but not save a new cache. For instance when you run workflows on a tag action, then you probably want to read caches from the main/default branch, but you most likely do not want to create new caches. The current solution is to separate restore and save actions which is cumbersome.

In #1452 the always_save feature was removed.

I propose to add a new config save-on-success that defaults to true and can be set false to prevent cache writing. Now this new value can be set from available context - just like you could when separating the steps - granted the decision must be available upfront. That above described decision is in fact available immediately on job creation. So we can use the new setting to simplify the setup.

How Has This Been Tested?

Local experiments

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (add or update README or docs)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@helly25 helly25 requested a review from a team as a code owner March 11, 2025 20:21
@helly25 helly25 force-pushed the feat/save_on_success branch from b38d23e to 40b3745 Compare April 25, 2025 13:45
@Rossbro2
Copy link

What is the status of this? This could really improve our workflows!

helly25 and others added 2 commits May 21, 2025 21:40
Co-authored-by: Kyle Ross <37418852+Rossbro2@users.noreply.github.com>
Co-authored-by: Kyle Ross <37418852+Rossbro2@users.noreply.github.com>
@helly25
Copy link
Author
helly25 commented May 21, 2025

What is the status of this? This could really improve our workflows!

An owner needs to approve the workflows and merge on green :-)

@Rossbro2
Copy link

@salmanmkc any chance you could approve, merge & release this? I've tested this on a fork and this is working great!

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.

3 participants
0