From 83b41897f8e7a2271dcd38478b23198e5ac1c081 Mon Sep 17 00:00:00 2001
From: Franck Nijhof <git@frenck.dev>
Date: Sun, 5 Jul 2020 01:59:22 +0200
Subject: [PATCH] GitHub Actions: Add codespell problem matcher (#37487)

* GitHub Actions: Add codespell problem matcher

* Add some spelling issues for test

* Disable color, might throw off matcher

* Revert "Add some spelling issues for test"

This reverts commit 3afb59c8d9c4080621fc90d25d228fa308b80a4b.
---
 .github/workflows/ci.yaml                 |  5 ++++-
 .github/workflows/matchers/codespell.json | 16 ++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 .github/workflows/matchers/codespell.json

diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 43fe1bfebb3..29ff69d6a76 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -195,10 +195,13 @@ jobs:
         run: |
           echo "Failed to restore Python virtual environment from cache"
           exit 1
+      - name: Register codespell problem matcher
+        run: |
+          echo "::add-matcher::.github/workflows/matchers/codespell.json"
       - name: Run codespell
         run: |
           . venv/bin/activate
-          pre-commit run --show-diff-on-failure --color=always --hook-stage manual codespell --all-files
+          pre-commit run --show-diff-on-failure --hook-stage manual codespell --all-files
 
   lint-dockerfile:
     name: Check Dockerfile
diff --git a/.github/workflows/matchers/codespell.json b/.github/workflows/matchers/codespell.json
new file mode 100644
index 00000000000..cfa66d31392
--- /dev/null
+++ b/.github/workflows/matchers/codespell.json
@@ -0,0 +1,16 @@
+{
+  "problemMatcher": [
+    {
+      "owner": "codespell",
+      "severity": "warning",
+      "pattern": [
+        {
+          "regexp": "^(.+):(\\d+):\\s(.+)$",
+          "file": 1,
+          "line": 2,
+          "message": 3
+        }
+      ]
+    }
+  ]
+}
-- 
GitLab