Skip to content

Support for GitHub Actions expression syntax (${{ ... }}) in ShellCheck linting #2

@DMGiulioRomano

Description

@DMGiulioRomano

Hi!

First of all, thanks for the extension — it’s super useful for highlighting and linting shell scripts in GitHub Actions workflows.

I noticed an issue when using ShellCheck inside .github/workflows/*.yaml scripts, for example with this snippet:

if [[ "${{ github.ref }}" == "refs/tags/v"* ]]; then
    echo "This is a tag starting with v"
fi
  • ShellCheck (SC2193) reports:

    The arguments to this comparison can never be equal. Make sure your syntax is correct.

  • The problem is that ShellCheck does not recognize GitHub Actions expressions like ${{ github.ref }}, and treats them as literal strings. This produces a false positive.

Suggestion:

It would be great if the extension could detect GitHub Actions expressions and either:

  1. Ignore them in static analysis, or
  2. Evaluate them in a GitHub Actions context for linting purposes.

This would prevent false positives like SC2193 when using GitHub-specific syntax in shell scripts inside workflows.

Thanks a lot for considering this improvement!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions