Skip to content

Commit

Permalink
fix: Remove problem matcher after run (hadolint#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnested committed Dec 6, 2020
1 parent bf7fe9f commit 1623ba6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion hadolint.sh
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion problem-matcher.json
@@ -1,7 +1,7 @@
{
"problemMatcher": [
{
"owner": "hadolint",
"owner": "brpaz/hadolint-action",
"pattern": [
{
"regexp": "(.*)\\:(\\d+)\\s(.*)",
Expand Down

0 comments on commit 1623ba6

Please sign in to comment.