From 637bb438ece579707f2ac0286d8c7710d1ee6721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Sun, 5 Jul 2020 23:50:07 +0200 Subject: [PATCH] Adds problem-matcher (#20) * Adds problem-matcher * Fix issue * match as group 1 * use message * Limit output * remove testfile --- .github/problem-matcher.json | 22 ++++++++++++++++++++++ runaction | 3 +++ testfiles/ignore/ignore.sh | 4 +++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .github/problem-matcher.json diff --git a/.github/problem-matcher.json b/.github/problem-matcher.json new file mode 100644 index 0000000..c5b8441 --- /dev/null +++ b/.github/problem-matcher.json @@ -0,0 +1,22 @@ +{ + "problemMatcher": [ + { + "owner": "shellcheck", + "pattern": [ + { + "regexp": "^In\\s(.+)\\sline\\s(\\d+):$", + "file": 1, + "line": 2 + }, + { + "regexp": ".*" + }, + { + "regexp": "(SC\\d+):\\s(.+)$", + "code": 1, + "message": 2 + } + ] + } + ] + } \ No newline at end of file diff --git a/runaction b/runaction index 367db50..97e8e5d 100755 --- a/runaction +++ b/runaction @@ -1,5 +1,8 @@ #!/bin/bash +## Enable problem matcher +echo "::add-matcher::.github/problem-matcher.json" + cd "$GITHUB_WORKSPACE" || exit 1 declare statuscode diff --git a/testfiles/ignore/ignore.sh b/testfiles/ignore/ignore.sh index a77dd19..3c116a9 100644 --- a/testfiles/ignore/ignore.sh +++ b/testfiles/ignore/ignore.sh @@ -1,3 +1,5 @@ #!/bin/sh -echo $test \ No newline at end of file +echo $test $test + +echo $test2 \ No newline at end of file