Skip to content

Commit

Permalink
Make problem matcher available to published action
Browse files Browse the repository at this point in the history
  • Loading branch information
nosborn committed Dec 21, 2021
1 parent 6e8c18c commit 018fc8b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .dockerignore
@@ -1 +1,2 @@
!markdownlint-problem-matcher.json
!entrypoint.sh
5 changes: 2 additions & 3 deletions Dockerfile
@@ -1,8 +1,7 @@
FROM node:lts-alpine

# hadolint ignore=DL3018
RUN npm install --global --production markdownlint-cli@0.30.0 \
&& apk --update --no-cache add curl jq
RUN npm install --global --production --update-notifier=false markdownlint-cli@0.30.0

COPY entrypoint.sh /entrypoint.sh
COPY markdownlint-problem-matcher.json /markdownlint-problem-matcher.json
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -12,7 +12,7 @@ Basic usage with all options enabled:
```yaml

- name: markdownlint-cli
uses: nosborn/github-action-markdown-cli@v3.0.0
uses: nosborn/github-action-markdown-cli@v3.0.1
with:
files: .
config_file: .markdownlint.yaml
Expand Down
5 changes: 4 additions & 1 deletion entrypoint.sh
Expand Up @@ -6,7 +6,10 @@ MARKDOWNLINT="${MARKDOWNLINT}${INPUT_IGNORE_FILES:+ -i ${INPUT_IGNORE_FILES}}"
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_IGNORE_PATH:+ -p ${INPUT_IGNORE_PATH}}"
MARKDOWNLINT="${MARKDOWNLINT}${INPUT_RULES:+ -r ${INPUT_RULES}}"

echo '::add-matcher::.github/markdownlint-problem-matcher.json'
PROBLEM_MATCHER="$(mktemp -p "${GITHUB_WORKSPACE}")"
trap 'rm -f "${PROBLEM_MATCHER}"' EXIT
cp /markdownlint-problem-matcher.json "${PROBLEM_MATCHER:?}" || exit
echo "::add-matcher::${PROBLEM_MATCHER:?}"

# shellcheck disable=SC2086
${MARKDOWNLINT} ${INPUT_FILES}
Expand Down
File renamed without changes.

0 comments on commit 018fc8b

Please sign in to comment.