question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conditional on a job fails if double quotes are used

See original GitHub issue

Describe the bug Using double quotes in a conditional for a job results in

The workflow is not valid. <file_path>: Unexpected symbol: '"workflow_dispatch"'. Located at position 22 within expression: github.event_name != "workflow_dispatch"

To Reproduce Steps to reproduce the behavior:

  1. Create a job with a conditional
test-job:
    name: Use double quotes
    if: github.event_name != "workflow_dispatch"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
  1. Run it
  2. See above mentioned error
  3. Use single quotes instead if: github.event_name != 'workflow_dispatch', it works

Expected behavior Job should pass regardless of type of quotes used

Runner Version and Platform

2.274.2

OS of the machine running the runner? Ubuntu 18.04

What’s not working?

N/A

Job Log Output

N/A

Runner and Worker’s Diagnostic Logs

N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:19
  • Comments:6

github_iconTop GitHub Comments

6reactions
ruvceskistefancommented, Mar 9, 2022

GitHub Actions only support the use of single quotes for strings in expression language, not double quotes (see docs). This is an intentional limitation (at least for now) and is not something that can be fixed in the runner application. Therefore, I’m going to close this issue, and you feel free to create a feature request on the GitHub Community Support Forum which is actively monitored. Using the forum ensures that we route your feature request to the correct team. 😃

4reactions
solarmosaic-kflorencecommented, Nov 12, 2021

@drecali I’m aware that the documentation mentions only single quote is valid (after the fact, of course). However, I think that behavior is not intuitive, since double quotes are valid throughout the rest of the YAML syntax. Unless there is a good reason not to support double quotes, it should be fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do options in a quoted variable fail, but work when ...
When you access the variable with a quoted substitution wget "$wget_options" , the value of the variable is used as a string.
Read more >
Solution for find -exec if single and double quotes already ...
The proper fix is to pass the matching files as command-line arguments to the bash subprocess.
Read more >
How to use Backticks and quotes when querying a MySQL ...
Using Backticks, Double Quotes, and Single Quotes when querying a MySQL database can be boiled down to two basic points: Quotes (Single and...
Read more >
Filter with quotes as string - Microsoft Q&A
I have a filter condition in which it is given as string e.g, if columnName is firstname then filter condition is firstname =...
Read more >
Job dependency scheduling
Use double quotes (") around job names that begin with a number. In Windows, enclose the dependency expression in double quotes (") when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found