From db62d43a24e36ed35e2b4c8861d79c0356dfcd56 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Sun, 14 Apr 2024 13:46:49 +0100 Subject: [PATCH] Skip the post run step entirely if the cache is disabled Previously if the `cache: false` (the default for this Action), the Action's "post run" step would still be executed. Whilst this step was fast (since it returned early if the cache was disabled), it still causes unnecessary noise in the job's steps list. For example as seen in: https://github.com/pypa/get-pip/actions/runs/8679713478/job/23798960684 Now, the post run step is skipped if the cache is disabled, thanks to the `post-if` syntax supporting the `github.events.inputs.*` context. See: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runspost-if https://github.com/actions/cache/blob/0c45773b623bea8c8e75f6c82b208c3cf94ea4f9/action.yml#L40 --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 5c4669759..6db0ea760 100644 --- a/action.yml +++ b/action.yml @@ -37,7 +37,7 @@ runs: using: 'node20' main: 'dist/setup/index.js' post: 'dist/cache-save/index.js' - post-if: success() + post-if: 'success() && github.event.inputs.cache' branding: icon: 'code' color: 'yellow'