Skip to content

Commit abb249d

Browse files
committed
check example input causes some error in update-checks-doc tool
1 parent bf03731 commit abb249d

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

scripts/update-checks-doc/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ func Actionlint(src []byte) ([]byte, error) {
6464
if err != nil {
6565
return nil, err
6666
}
67-
if _, err := l.Lint("test.yaml", src, p); err != nil {
67+
errs, err := l.Lint("test.yaml", src, p)
68+
if err != nil {
6869
return nil, err
6970
}
71+
if len(errs) == 0 {
72+
return nil, errors.New("the input example caused no error")
73+
}
7074

7175
// Some error message contains absolute file paths. Replace them not to make the document depend
7276
// on the current file system.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<a id="hello"></a>
2+
## Hello
3+
4+
Example input:
5+
6+
```yaml
7+
on: push
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- run: echo hello
13+
```
14+
15+
Output:
16+
17+
```
18+
```
19+
20+
[Playground](https://rhysd.github.io/actionlint/#THIS_URL_WILL_BE_UPDATED)
21+
22+
The example input does not cause any error.

scripts/update-checks-doc/testdata/err/too_long_input_line.md

Lines changed: 17 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)