Skip to content

Commit

Permalink
avoid runner labels update affects other test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Feb 15, 2024
1 parent 7b47a3d commit 5b9c4f3
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 13 deletions.
2 changes: 1 addition & 1 deletion testdata/format/test.json
Original file line number Diff line number Diff line change
@@ -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}]
3 changes: 2 additions & 1 deletion testdata/format/test.jsonl
Original file line number Diff line number Diff line change
@@ -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}
17 changes: 13 additions & 4 deletions testdata/format/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
^~~~~
```

36 changes: 30 additions & 6 deletions testdata/format/test.sarif
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand All @@ -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 ^~~~~"
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion testdata/format/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5b9c4f3

Please sign in to comment.