Skip to content

Commit

Permalink
feat: add option to not save cache (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
navijation authored Apr 25, 2024
1 parent bf6479d commit c683728
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ jobs:
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true, caches will not be saved, but they may still be restored,
# subject to other options
# skip-save-cache: true

# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
# skip-pkg-cache: true

Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ inputs:
takes precedence over all other caching options.
default: 'false'
required: false
skip-save-cache:
description: |
if set to true then the action will not save any caches, but it may still
restore existing caches, subject to other options.
default: 'false'
required: false
skip-pkg-cache:
description: "if set to true then the action doesn't cache or restore ~/go/pkg."
default: 'false'
Expand Down
2 changes: 2 additions & 0 deletions dist/post_run/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/run/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export async function restoreCache(): Promise<void> {

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

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

0 comments on commit c683728

Please sign in to comment.