Skip to content

Commit 262ac43

Browse files
committed
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
1 parent 532b046 commit 262ac43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ runs:
4242
using: 'node20'
4343
main: 'dist/setup/index.js'
4444
post: 'dist/cache-save/index.js'
45-
post-if: success()
45+
post-if: 'success() && github.event.inputs.cache'
4646
branding:
4747
icon: 'code'
4848
color: 'yellow'

0 commit comments

Comments
 (0)