Skip to content
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

feat: add option to not save cache #851

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
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
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
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