Skip to content

Commit c683728

Browse files
authored
feat: add option to not save cache (#851)
1 parent bf6479d commit c683728

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

Diff for: README.md

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ jobs:
6767
# takes precedence over all other caching options.
6868
# skip-cache: true
6969

70+
# Optional: if set to true, caches will not be saved, but they may still be restored,
71+
# subject to other options
72+
# skip-save-cache: true
73+
7074
# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
7175
# skip-pkg-cache: true
7276

Diff for: action.yml

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ inputs:
2929
takes precedence over all other caching options.
3030
default: 'false'
3131
required: false
32+
skip-save-cache:
33+
description: |
34+
if set to true then the action will not save any caches, but it may still
35+
restore existing caches, subject to other options.
36+
default: 'false'
37+
required: false
3238
skip-pkg-cache:
3339
description: "if set to true then the action doesn't cache or restore ~/go/pkg."
3440
default: 'false'

Diff for: dist/post_run/index.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/run/index.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/cache.ts

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export async function restoreCache(): Promise<void> {
116116

117117
export async function saveCache(): Promise<void> {
118118
if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return
119+
if (core.getInput(`skip-save-cache`, { required: true }).trim() == "true") return
119120

120121
// Validate inputs, this can cause task failure
121122
if (!utils.isValidEvent()) {

0 commit comments

Comments
 (0)