From fc2df39c33a5c3eceb1308d495814cb0a80bd0da Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 11:54:54 -0700 Subject: [PATCH] ci: add problem matcher for patch conflict output (#47224) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: David Sanders --- .github/actions/checkout/action.yml | 9 +++++++- .github/problem-matchers/patch-conflict.json | 24 ++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/problem-matchers/patch-conflict.json diff --git a/.github/actions/checkout/action.yml b/.github/actions/checkout/action.yml index 205eefde25..b4f6ca7f21 100644 --- a/.github/actions/checkout/action.yml +++ b/.github/actions/checkout/action.yml @@ -80,6 +80,9 @@ runs: else echo "The cross mount cache has $freespace_human free space - continuing" fi + - name: Add patch conflict problem matcher + shell: bash + run: echo "::add-matcher::src/electron/.github/problem-matchers/patch-conflict.json" - name: Gclient Sync if: steps.check-cache.outputs.cache_exists == 'false' shell: bash @@ -128,7 +131,11 @@ runs: echo "No changes to patches detected" fi fi - + - name: Remove patch conflict problem matcher + shell: bash + run: | + echo "::remove-matcher owner=merge-conflict::" + echo "::remove-matcher owner=patch-conflict::" # delete all .git directories under src/ except for # third_party/angle/ and third_party/dawn/ because of build time generation of files # gen/angle/commit.h depends on third_party/angle/.git/HEAD diff --git a/.github/problem-matchers/patch-conflict.json b/.github/problem-matchers/patch-conflict.json new file mode 100644 index 0000000000..e8324448cb --- /dev/null +++ b/.github/problem-matchers/patch-conflict.json @@ -0,0 +1,24 @@ +{ + "problemMatcher": [ + { + "owner": "merge-conflict", + "pattern": [ + { + "regexp": "^CONFLICT\\s\\(\\S+\\): (Merge conflict in \\S+)$", + "message": 1 + } + ] + }, + { + "owner": "patch-conflict", + "pattern": [ + { + "regexp": "^error: (patch failed: (\\S+):(\\d+))$", + "message": 1, + "file": 2, + "line": 3 + } + ] + } + ] +}