From 5b9c4f3d5dbea832b3a6e012ac1ff32bc4cce8e0 Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 15 Feb 2024 22:24:32 +0900 Subject: [PATCH] avoid runner labels update affects other test cases --- testdata/format/test.json | 2 +- testdata/format/test.jsonl | 3 ++- testdata/format/test.md | 17 +++++++++++++---- testdata/format/test.sarif | 36 ++++++++++++++++++++++++++++++------ testdata/format/test.yaml | 5 ++++- 5 files changed, 50 insertions(+), 13 deletions(-) diff --git a/testdata/format/test.json b/testdata/format/test.json index 7aca80956..18b6c672f 100644 --- a/testdata/format/test.json +++ b/testdata/format/test.json @@ -1 +1 @@ -[{"message":"unexpected key \"branch\" for \"push\" section. expected one of \"branches\", \"branches-ignore\", \"paths\", \"paths-ignore\", \"tags\", \"tags-ignore\", \"types\", \"workflows\"","filepath":"testdata/format/test.yaml","line":3,"column":5,"kind":"syntax-check","snippet":" branch: main\n ^~~~~~~","end_column":11},{"message":"label \"linux-latest\" is unknown. available labels are \"windows-latest\", \"windows-2022\", \"windows-2019\", \"windows-2016\", \"ubuntu-latest\", \"ubuntu-22.04\", \"ubuntu-20.04\", \"macos-latest\", \"macos-latest-xl\", \"macos-latest-xlarge\", \"macos-latest-large\", \"macos-14-xl\", \"macos-14-xlarge\", \"macos-14-large\", \"macos-14\", \"macos-14.0\", \"macos-13-xl\", \"macos-13-xlarge\", \"macos-13-large\", \"macos-13\", \"macos-13.0\", \"macos-12-xl\", \"macos-12-xlarge\", \"macos-12-large\", \"macos-12\", \"macos-12.0\", \"macos-11\", \"macos-11.0\", \"macos-10.15\", \"self-hosted\", \"x64\", \"arm\", \"arm64\", \"linux\", \"macos\", \"windows\". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file","filepath":"testdata/format/test.yaml","line":6,"column":14,"kind":"runner-label","snippet":" runs-on: linux-latest\n ^~~~~~~~~~~~","end_column":25}] +[{"message":"unexpected key \"branch\" for \"push\" section. expected one of \"branches\", \"branches-ignore\", \"paths\", \"paths-ignore\", \"tags\", \"tags-ignore\", \"types\", \"workflows\"","filepath":"testdata/format/test.yaml","line":3,"column":5,"kind":"syntax-check","snippet":" branch: main\n ^~~~~~~","end_column":11},{"message":"property \"msg\" is not defined in object type {}","filepath":"testdata/format/test.yaml","line":9,"column":23,"kind":"expression","snippet":" - run: echo ${{ matrix.msg }}\n ^~~~~~~~~~","end_column":32},{"message":"this step is for running shell command since it contains at least one of \"run\", \"shell\" keys, but also contains \"with\" key which is used for running action","filepath":"testdata/format/test.yaml","line":10,"column":9,"kind":"syntax-check","snippet":" with:\n ^~~~~","end_column":13}] diff --git a/testdata/format/test.jsonl b/testdata/format/test.jsonl index 22623529d..dc0a9012e 100644 --- a/testdata/format/test.jsonl +++ b/testdata/format/test.jsonl @@ -1,2 +1,3 @@ {"message":"unexpected key \"branch\" for \"push\" section. expected one of \"branches\", \"branches-ignore\", \"paths\", \"paths-ignore\", \"tags\", \"tags-ignore\", \"types\", \"workflows\"","filepath":"testdata/format/test.yaml","line":3,"column":5,"kind":"syntax-check","snippet":" branch: main\n ^~~~~~~","end_column":11} -{"message":"label \"linux-latest\" is unknown. available labels are \"windows-latest\", \"windows-2022\", \"windows-2019\", \"windows-2016\", \"ubuntu-latest\", \"ubuntu-22.04\", \"ubuntu-20.04\", \"macos-latest\", \"macos-latest-xl\", \"macos-latest-xlarge\", \"macos-latest-large\", \"macos-14-xl\", \"macos-14-xlarge\", \"macos-14-large\", \"macos-14\", \"macos-14.0\", \"macos-13-xl\", \"macos-13-xlarge\", \"macos-13-large\", \"macos-13\", \"macos-13.0\", \"macos-12-xl\", \"macos-12-xlarge\", \"macos-12-large\", \"macos-12\", \"macos-12.0\", \"macos-11\", \"macos-11.0\", \"macos-10.15\", \"self-hosted\", \"x64\", \"arm\", \"arm64\", \"linux\", \"macos\", \"windows\". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file","filepath":"testdata/format/test.yaml","line":6,"column":14,"kind":"runner-label","snippet":" runs-on: linux-latest\n ^~~~~~~~~~~~","end_column":25} +{"message":"property \"msg\" is not defined in object type {}","filepath":"testdata/format/test.yaml","line":9,"column":23,"kind":"expression","snippet":" - run: echo ${{ matrix.msg }}\n ^~~~~~~~~~","end_column":32} +{"message":"this step is for running shell command since it contains at least one of \"run\", \"shell\" keys, but also contains \"with\" key which is used for running action","filepath":"testdata/format/test.yaml","line":10,"column":9,"kind":"syntax-check","snippet":" with:\n ^~~~~","end_column":13} diff --git a/testdata/format/test.md b/testdata/format/test.md index dc46c334f..088a4bdba 100644 --- a/testdata/format/test.md +++ b/testdata/format/test.md @@ -7,12 +7,21 @@ unexpected key "branch" for "push" section. expected one of "branches", "branche ^~~~~~~ ``` -### Error at line 6, col 14 of `testdata/format/test.yaml` +### Error at line 9, col 23 of `testdata/format/test.yaml` -label "linux-latest" is unknown. available labels are "windows-latest", "windows-2022", "windows-2019", "windows-2016", "ubuntu-latest", "ubuntu-22.04", "ubuntu-20.04", "macos-latest", "macos-latest-xl", "macos-latest-xlarge", "macos-latest-large", "macos-14-xl", "macos-14-xlarge", "macos-14-large", "macos-14", "macos-14.0", "macos-13-xl", "macos-13-xlarge", "macos-13-large", "macos-13", "macos-13.0", "macos-12-xl", "macos-12-xlarge", "macos-12-large", "macos-12", "macos-12.0", "macos-11", "macos-11.0", "macos-10.15", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file +property "msg" is not defined in object type {} ``` - runs-on: linux-latest - ^~~~~~~~~~~~ + - run: echo ${{ matrix.msg }} + ^~~~~~~~~~ +``` + +### Error at line 10, col 9 of `testdata/format/test.yaml` + +this step is for running shell command since it contains at least one of "run", "shell" keys, but also contains "with" key which is used for running action + +``` + with: + ^~~~~ ``` diff --git a/testdata/format/test.sarif b/testdata/format/test.sarif index 3c8547ae8..97ea7a493 100644 --- a/testdata/format/test.sarif +++ b/testdata/format/test.sarif @@ -278,9 +278,9 @@ ] }, { - "ruleId": "runner-label", + "ruleId": "expression", "message": { - "text": "label \"linux-latest\" is unknown. available labels are \"windows-latest\", \"windows-2022\", \"windows-2019\", \"windows-2016\", \"ubuntu-latest\", \"ubuntu-22.04\", \"ubuntu-20.04\", \"macos-latest\", \"macos-latest-xl\", \"macos-latest-xlarge\", \"macos-latest-large\", \"macos-14-xl\", \"macos-14-xlarge\", \"macos-14-large\", \"macos-14\", \"macos-14.0\", \"macos-13-xl\", \"macos-13-xlarge\", \"macos-13-large\", \"macos-13\", \"macos-13.0\", \"macos-12-xl\", \"macos-12-xlarge\", \"macos-12-large\", \"macos-12\", \"macos-12.0\", \"macos-11\", \"macos-11.0\", \"macos-10.15\", \"self-hosted\", \"x64\", \"arm\", \"arm64\", \"linux\", \"macos\", \"windows\". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file" + "text": "property \"msg\" is not defined in object type {}" }, "locations": [ { @@ -290,11 +290,35 @@ "uriBaseId": "%SRCROOT%" }, "region": { - "startLine": 6, - "startColumn": 14, - "endColumn": 25, + "startLine": 9, + "startColumn": 23, + "endColumn": 32, "snippet": { - "text": " runs-on: linux-latest\n ^~~~~~~~~~~~" + "text": " - run: echo ${{ matrix.msg }}\n ^~~~~~~~~~" + } + } + } + } + ] + }, + { + "ruleId": "syntax-check", + "message": { + "text": "this step is for running shell command since it contains at least one of \"run\", \"shell\" keys, but also contains \"with\" key which is used for running action" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "testdata/format/test.yaml", + "uriBaseId": "%SRCROOT%" + }, + "region": { + "startLine": 10, + "startColumn": 9, + "endColumn": 13, + "snippet": { + "text": " with:\n ^~~~~" } } } diff --git a/testdata/format/test.yaml b/testdata/format/test.yaml index 64f0d19b0..d922ed60f 100644 --- a/testdata/format/test.yaml +++ b/testdata/format/test.yaml @@ -3,6 +3,9 @@ on: branch: main jobs: test: - runs-on: linux-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - run: echo ${{ matrix.msg }} + with: + arg: foo