From 1623ba61710b974b55ba455930e6f2c8ef919778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sun, 6 Dec 2020 20:10:45 +0100 Subject: [PATCH] fix: Remove problem matcher after run (#16) --- hadolint.sh | 10 +++++++++- problem-matcher.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hadolint.sh b/hadolint.sh index 3827766..34731f5 100755 --- a/hadolint.sh +++ b/hadolint.sh @@ -7,7 +7,15 @@ TMP_FOLDER=$(mktemp -d -p .) cp /problem-matcher.json "${TMP_FOLDER}" chmod -R a+rX "${TMP_FOLDER}" -trap "rm -rf \"${TMP_FOLDER}\"" EXIT + +# After the run has finished we remove the problem-matcher.json from +# the repository so we don't leave the checkout dirty. We also remove +# the matcher so it won't take effect in later steps. +cleanup() { + echo "::remove-matcher owner=brpaz/hadolint-action::" + rm -rf "${TMP_FOLDER}" +} +trap cleanup EXIT echo "::add-matcher::${TMP_FOLDER}/problem-matcher.json" diff --git a/problem-matcher.json b/problem-matcher.json index f720974..215a6e0 100644 --- a/problem-matcher.json +++ b/problem-matcher.json @@ -1,7 +1,7 @@ { "problemMatcher": [ { - "owner": "hadolint", + "owner": "brpaz/hadolint-action", "pattern": [ { "regexp": "(.*)\\:(\\d+)\\s(.*)",