0

I'm using VS Code and working on GitHub Actions workflow files. I'm using the GitHub Actions extension.

I'm having issues with the linter. VS Code is showing me some errors and warnings that are incorrect:

My workflow looks like:

on:
  push:
    branches:
      - main


jobs:
  my-job:
    if: "!startsWith(github.event.head_commit.message, 'special message')"
    runs-on: my-runner
    container:
      image: my-image
      credentials:
        username: ${{ secrets.MY_USERNAME }}
        password: ${{ secrets.MY_PASSWORD }}

VS Code is raising issues:

[{
    "resource": "my_workflow.yml",
    "owner": "_generated_diagnostic_collection_name_#4",
    "severity": 8,
    "message": "Unexpected symbol: '\"'. Located at position 1 within expression: \"!startsWith(github.event.head_commit.message, 'chore(main): release')\"",
    "startLineNumber": 8,
    "startColumn": 9,
    "endLineNumber": 8,
    "endColumn": 80,
    "origin": "extHost1"
},{
    "resource": "my_workflow.yml",
    "owner": "_generated_diagnostic_collection_name_#4",
    "severity": 4,
    "message": "Context access might be invalid: MY_USERNAME",
    "startLineNumber": 13,
    "startColumn": 19,
    "endLineNumber": 13,
    "endColumn": 45,
    "origin": "extHost1"
},{
    "resource": "my_workflow.yml",
    "owner": "_generated_diagnostic_collection_name_#4",
    "severity": 4,
    "message": "Context access might be invalid: MY_PASSWORD",
    "startLineNumber": 14,
    "startColumn": 19,
    "endLineNumber": 14,
    "endColumn": 45,
    "origin": "extHost1"
}]

Lints from VSCode

lints

But those are valid because the workflow runs properly.

My file is using the "GitHub Actions Workflow" syntax:

Github Action Workflow syntax

So I must be missing a setup somewhere.

How to fix those lints?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.