Skip to content

expression-literal-text-in-condition vs. yaml #542

@mighdoll

Description

@mighdoll

Describe the bug
I have a line like this in the workflow yaml:

jobs:
  publish:
    if: "${{ startsWith(github.event.head_commit.message, 'chore: release') }}"

I get this error in vscode

Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?(expression-literal-text-in-condition)

Is there a way to at least disable the warning?

(Note that if I remove the quotes and ${{ }}, I'd get an error from yaml parsing, because the of the colon in the quoted string)

To Reproduce>
open a worfklow with that line in it in vscode. Here's an example.

Expected behavior

a way to disable the warning.

Screenshots

This workflow works, but now generates a warning in vscode:
Image

Removing the quotes and ${{ }} as the warning suggests leads to another warning (and I think will fail to execute correctly).
Image

Extension Version
0.28.2

Additional context
I think it used to work. Maybe a change recently introduced this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog 🗒

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions