From 333d5bfffff6a64afc64af94f509a20c396f5bb5 Mon Sep 17 00:00:00 2001 From: Kevin Cui Date: Fri, 6 Sep 2024 10:02:19 +0800 Subject: [PATCH] feat(action): add save-always input Signed-off-by: Kevin Cui --- README.md | 6 ++++++ action.yaml | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 50bb949..93e561f 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,12 @@ default: `false` If `true`, disable saving cache upon cache miss. +#### `save-always` + +default: `false` + +If `true`, run the post step to save the cache even if another step before fails. + ## Outputs ### `cache-hit` diff --git a/action.yaml b/action.yaml index 720b07f..5cd967d 100644 --- a/action.yaml +++ b/action.yaml @@ -15,6 +15,10 @@ inputs: description: If "true", disables saving the cache upon cache miss required: false default: "false" + save-always: + description: "Run the post step to save the cache even if another step before fails" + required: false + default: "false" outputs: cache-hit: description: > @@ -23,5 +27,5 @@ outputs: runs: using: node20 main: dist/main/index.js - post-if: success() + post-if: "success() || github.event.inputs.save-always" post: dist/post/index.js