Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status Check Functions in conditionals #3639

Open
jessesuen opened this issue Mar 11, 2025 · 2 comments
Open

Status Check Functions in conditionals #3639

jessesuen opened this issue Mar 11, 2025 · 2 comments

Comments

@jessesuen
Copy link
Member

Proposed Feature

This is a follow up to #3125.

We added conditionals, but would now like the ability to run steps based on status conditions (e.g. always, or upon failure).

GitHub Actions solves this by re-using their if clause with Status Check Functions.

Examples:

if: ${{ success() }}
if: ${{ always() }}
if: ${{ cancelled() }}
if: ${{ failure() }}

At first I felt reusing the if clause for this purpose seemed a bit too magical and preferred this to be in a separate field. From docs:

A default status check of success() is applied unless you include one of these functions

However, after thinking about this more, having it in the if clause has advantages over introducing it into another field because it can be mixed with other checks. e.g.:

if: ${{ failure() && steps.demo.conclusion == 'failure' }}

So I am in favor of GitHub's approach to this.

Motivation

This would be useful in things like notification steps

Suggested Implementation

Introduce status check functions understood in the if clause.

@jessesuen
Copy link
Member Author

jessesuen commented Mar 11, 2025

@krancour
Copy link
Member

I would happily close #3228 in favor of this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants