Skip to content

Commit

Permalink
fix: Fix problem matcher (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnested committed Dec 5, 2020
1 parent 88386d9 commit 7e374b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM hadolint/hadolint:v1.17.5-alpine

COPY LICENSE README.md /
COPY LICENSE README.md problem-matcher.json /
COPY hadolint.sh /usr/local/bin/hadolint.sh

ENTRYPOINT [ "/usr/local/bin/hadolint.sh" ]
11 changes: 10 additions & 1 deletion hadolint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/bin/sh

echo '::add-matcher::problem-matcher.json'
# The problem-matcher definition must be present in the repository
# checkout (outside the Docker container running hadolint). We create
# a temporary folder and copy problem-matcher.json to it and make it
# readable.
TMP_FOLDER=$(mktemp -d -p .)
cp /problem-matcher.json "${TMP_FOLDER}"
chmod -R a+rX "${TMP_FOLDER}"
trap "rm -rf \"${TMP_FOLDER}\"" EXIT

echo "::add-matcher::${TMP_FOLDER}/problem-matcher.json"

hadolint "$@"

0 comments on commit 7e374b1

Please sign in to comment.