Skip to content

${{ / }} wrappings around Job status check functions could be omitted #7601

Description

@jsoref

What article on docs.github.com is affected?

https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#job-status-check-functions

What part(s) of the article would you like to see updated?

https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#example-6

 if: ${{ success() }}

https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#example-7

if: ${{ always() }}

https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#example-7

if: ${{ cancelled() }}

https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#example-9

 if: ${{ failure() }}

Additional information

Technically the ${{ and }} here are optional

https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#about-contexts-and-expressions

When you use expressions in an if conditional, you may omit the expression syntax (${{ }}) because GitHub automatically evaluates the if conditional as an expression, unless the expression contains any operators. If the expression contains any operators, the expression must be contained within ${{ }} to explicitly mark it for evaluation. For more information about if conditionals, see "Workflow syntax for GitHub Actions."

It'd be nice if the document helped people internalize when they need to / don't need to use ${{/}}, by not using ${{/}} in places where they aren't necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionsThis issue or pull request should be reviewed by the docs actions teamcontentThis issue or pull request belongs to the Docs Content team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions