feat: add option to not save cache (#851)
This commit is contained in:
parent
bf6479d5ec
commit
c683728f10
@ -67,6 +67,10 @@ jobs:
|
|||||||
# takes precedence over all other caching options.
|
# takes precedence over all other caching options.
|
||||||
# skip-cache: true
|
# 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.
|
# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
|
||||||
# skip-pkg-cache: true
|
# skip-pkg-cache: true
|
||||||
|
|
||||||
|
@ -29,6 +29,12 @@ inputs:
|
|||||||
takes precedence over all other caching options.
|
takes precedence over all other caching options.
|
||||||
default: 'false'
|
default: 'false'
|
||||||
required: 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:
|
skip-pkg-cache:
|
||||||
description: "if set to true then the action doesn't cache or restore ~/go/pkg."
|
description: "if set to true then the action doesn't cache or restore ~/go/pkg."
|
||||||
default: 'false'
|
default: 'false'
|
||||||
|
2
dist/post_run/index.js
generated
vendored
2
dist/post_run/index.js
generated
vendored
@ -88900,6 +88900,8 @@ exports.restoreCache = restoreCache;
|
|||||||
async function saveCache() {
|
async function saveCache() {
|
||||||
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
|
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
|
||||||
return;
|
return;
|
||||||
|
if (core.getInput(`skip-save-cache`, { required: true }).trim() == "true")
|
||||||
|
return;
|
||||||
// Validate inputs, this can cause task failure
|
// Validate inputs, this can cause task failure
|
||||||
if (!utils.isValidEvent()) {
|
if (!utils.isValidEvent()) {
|
||||||
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
||||||
|
2
dist/run/index.js
generated
vendored
2
dist/run/index.js
generated
vendored
@ -88900,6 +88900,8 @@ exports.restoreCache = restoreCache;
|
|||||||
async function saveCache() {
|
async function saveCache() {
|
||||||
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
|
if (core.getInput(`skip-cache`, { required: true }).trim() == "true")
|
||||||
return;
|
return;
|
||||||
|
if (core.getInput(`skip-save-cache`, { required: true }).trim() == "true")
|
||||||
|
return;
|
||||||
// Validate inputs, this can cause task failure
|
// Validate inputs, this can cause task failure
|
||||||
if (!utils.isValidEvent()) {
|
if (!utils.isValidEvent()) {
|
||||||
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
||||||
|
@ -116,6 +116,7 @@ export async function restoreCache(): Promise<void> {
|
|||||||
|
|
||||||
export async function saveCache(): Promise<void> {
|
export async function saveCache(): Promise<void> {
|
||||||
if (core.getInput(`skip-cache`, { required: true }).trim() == "true") return
|
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
|
// Validate inputs, this can cause task failure
|
||||||
if (!utils.isValidEvent()) {
|
if (!utils.isValidEvent()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user