Skip to content

github-action.json if warning about ${{ }} is wrong #5215

@jsoref

Description

@jsoref

"description": "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.",

"description": "You can use the if conditional to prevent a step from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.",

  1. It should say something closer to:

    For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions

    Note the lack of a trailing ..
    Otherwise, you get something like:
    Image

  2. There are specific cases where you must use ${{ ... }}: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idif

    You must always use the ${{ }} expression syntax or escape with '', "", or () when the expression starts with !, since ! is reserved notation in YAML format. For example:

    if: ${{ ! startsWith(github.ref, 'refs/tags/') }}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions