From 6bc053e9234d8e279980500c1d0456e15a3cbd43 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Mon, 20 Apr 2020 08:06:44 +0900 Subject: [PATCH] fix: docker/entrypoint.sh (#38) Close #37 --- Dockerfile | 9 ++++++++- entrypoint.sh | 12 ++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4cc4304..cc71bab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,18 @@ FROM node:current-alpine ENV REVIEWDOG_VERSION=v0.9.17 + RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b /usr/local/bin/ ${REVIEWDOG_VERSION} RUN apk --update add git && \ rm -rf /var/lib/apt/lists/* && \ rm /var/cache/apk/* -COPY entrypoint.sh /entrypoint.sh +WORKDIR / +ENV PATH $PATH:/node_modules/.bin +COPY package.json package-lock.json / +RUN npm ci + +COPY entrypoint.sh / +RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index b75b8c7..0d9ccc0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,13 +4,9 @@ cd "$GITHUB_WORKSPACE" export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" -if [ ! -f "$(npm bin)/textlint" ]; then - npm install -fi +textlint --version -$(npm bin)/textlint --version - -$(npm bin)/textlint -f checkstyle "${INPUT_TEXTLINT_FLAGS:-'.'}" \ - | reviewdog -f=checkstyle -name="textlint" \ - -reporter="${INPUT_REPORTER:-'github-pr-check'}" \ +textlint -f checkstyle "${INPUT_TEXTLINT_FLAGS:-'.'}" \ + | reviewdog -f=checkstyle -name="textlint" \ + -reporter="${INPUT_REPORTER:-'github-pr-check'}" \ -level="${INPUT_LEVEL:-'error'}"