Skip to main content
All CollectionsKnowledge BaseGeneral issues
Cache is not saved for pull requests
Cache is not saved for pull requests
Updated over 3 months ago

Issue:

The Cache:Push Step does not run when a build is triggered by a pull request and no cache is saved.

Possible solutions:

This is working as intended. By default, the Cache:Push Step is skipped when a build is triggered by a pull request. If you look at the step.yml for the Step, you will see the run_if statement:

run_if: ".IsCI | and (not .IsPR)"

This evaluates to false for Pull Requests. As a result, the Step is not executed.

You can change this behavior by changing or deleting the run_if statement, but this is not recommended! Our recommendation is to only allow manual or CI builds to generate and save the cache. For security, a build triggered by a pull request should only be able to access the cache but not change it.

Additional information:

Did this answer your question?