Skip to content

Commit a506489

Browse files
richardlauMylesBorins
authored andcommittedApr 2, 2020
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 <riclau@uk.ibm.com> Backport-PR-URL: #32608 PR-URL: #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 <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
1 parent c42cb79 commit a506489

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)
Please sign in to comment.