Skip to content

Expressions / Literals should mention include ' and " and explicitly mention double quotes #14519

@jsoref

Description

@jsoref

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/learn-github-actions/expressions#literals

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

Data type Literal value
string You must use single quotes. Escape literal single-quotes with a single quote.
-You must use single quotes. Escape literal single-quotes with a single quote.
+You must use single quotes (`'`). To use a literal single-quote (`'`), use a pair of single quotes (`''`). Double quotes (`"`) will not work but will result in a confusing error. 

Additional information

I lost too much time trying to figure out why my double quoted strings weren't working.

The workflow is not valid. .github/workflows/test.yml (Line: 84, Col: 11): Unexpected symbol: '"success"'. Located at position 28 within expression: (steps.retrieve.outcome == "success") || (steps.find.outcome == "success")

There are parsers that yield more friendly errors, some spit out their grammar, in the form of:

expected ', 0-9, false, or true

... or something like that.

Also, friendlier error reporting generally reports errors based on the cursor of the file and not a substring of.a substring. In case people are wondering, the cursor position for the " is not equal to 11 + 28, the ${{ token doesn't appear to be considered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content teamhelp wantedAnyone is welcome to open a pull request to fix this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions