What is usage difference between: job.status == 'success' and if :success() ? #25173
-
Hi, what is possible usage difference between:
and
Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
job.status is a context of the current job. Possible values are success, failure, or cancelled. job.status could be used not only in if conditional but also in other places, such as using it as an input variable value of an action.
success() is a check function which could be used as an expression in if conditionals. When they are used in jobs.<job_id>.steps.if conditional, there is no difference between them. You could choose any one you like. success() could be used in jobs.<job_id>.if , but job.status could not. |
Beta Was this translation helpful? Give feedback.
-
Many thanks for explanation. |
Beta Was this translation helpful? Give feedback.
job.status is a context of the current job. Possible values are success, failure, or cancelled. job.status could be used not only in if conditional but also in other places, such as using it as an input variable value of an action.
success() is a check function which could be used as an expression in if conditionals.
When they are used in jobs.<job_id>.steps.if conditional, there is no difference between them. You could choose any one you like.
success() could be used in jobs.<job_id>.if , but job.status could not.