Skip to content

Commit f467b9b

Browse files
committed
build: annotate markdown lint failures in pull requests
Add a problem matcher for output from remark-lint to our lint-md GitHub Actions CI workflow so that any markdown linter failures are annotated in the pull request in the web UI. Signed-off-by: Richard Lau <[email protected]> PR-URL: nodejs#32391 Refs: https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md Refs: https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Matheus Marchini <[email protected]>
1 parent f92df33 commit f467b9b

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.github/workflows/CI.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ jobs:
6464
with:
6565
node-version: 10.x
6666
- name: Lint docs
67-
run: NODE=$(which node) make lint-md
67+
run: |
68+
echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json"
69+
NODE=$(which node) make lint-md
6870
lint-js:
6971
runs-on: ubuntu-latest
7072
steps:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "remark-lint",
5+
"pattern": [
6+
{
7+
"regexp": "^(?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)*$",
8+
"file": 1
9+
},
10+
{
11+
"regexp": "^\\s+(?:\\d+:\\d+-)?(\\d+):(\\d+)\\s+\\S*(error|warning|info)\\S*\\s+(.+)\\s+(\\S+)\\s+(?:\\S+)$",
12+
"line": 1,
13+
"column": 2,
14+
"severity": 3,
15+
"message": 4,
16+
"code": 5,
17+
"loop": true
18+
}
19+
]
20+
}
21+
]
22+
}

0 commit comments

Comments
 (0)