Run a post-entrypoint script on build cancellation #25987
-
Hello everyone ! I am working on a Docker based Action and I am wondering if there is a way to run a post-entrypoint cleanup script whenever a build is cancelled by a user. More specifically, will Thanks in advance ! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
obrassard:
Yes, post-entrypoint will always run in default even if a build is cancelled. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot @yanjingzhu for your answer ! |
Beta Was this translation helpful? Give feedback.
-
Hi @yanjingzhu, I tried to use the Here an excerpt of my action.yml file :slight_smile:
Am i missing something ? UPDATE : Never mind, using |
Beta Was this translation helpful? Give feedback.
Yes, post-entrypoint will always run in default even if a build is cancelled.
The
post:
action will only run if the conditions inpost-if
are met. Ifpost-if
is not set, then the condition defaults toalways()
.You could use cancelled() function in post-if, then the post action will only run when the build is canceled.