diff options
author | Richard Lau <riclau@uk.ibm.com> | 2020-03-20 07:49:34 -0400 |
---|---|---|
committer | Myles Borins <myles.borins@gmail.com> | 2020-04-02 00:49:46 -0400 |
commit | a50648975d854d8aad989163fd215a423385a02d (patch) | |
tree | 716c98514b8d670838cdf789dc40db00ead1b1c1 /.github | |
parent | c42cb79bb7ee5840d972628bbac37f04897e36a1 (diff) | |
download | node-new-a50648975d854d8aad989163fd215a423385a02d.tar.gz |
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: https://github.com/nodejs/node/pull/32608
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/CI.yml | 4 | ||||
-rw-r--r-- | .github/workflows/remark-lint-problem-matcher.json | 22 |
2 files changed, 25 insertions, 1 deletions
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 356a9f990e..f5b6281149 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -64,7 +64,9 @@ jobs: with: node-version: 10.x - name: Lint docs - run: NODE=$(which node) make lint-md + run: | + echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json" + NODE=$(which node) make lint-md lint-js: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/remark-lint-problem-matcher.json b/.github/workflows/remark-lint-problem-matcher.json new file mode 100644 index 0000000000..cfb281310a --- /dev/null +++ b/.github/workflows/remark-lint-problem-matcher.json @@ -0,0 +1,22 @@ +{ + "problemMatcher": [ + { + "owner": "remark-lint", + "pattern": [ + { + "regexp": "^(?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)*$", + "file": 1 + }, + { + "regexp": "^\\s+(?:\\d+:\\d+-)?(\\d+):(\\d+)\\s+\\S*(error|warning|info)\\S*\\s+(.+)\\s+(\\S+)\\s+(?:\\S+)$", + "line": 1, + "column": 2, + "severity": 3, + "message": 4, + "code": 5, + "loop": true + } + ] + } + ] +} |