Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto update #50

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/depup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: reviewdog/action-depup@v1
id: depup
with:
file: Dockerfile
file: docker/Dockerfile
version_name: REVIEWDOG_VERSION
repo: reviewdog/reviewdog

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ${{ github.repository }}:$(date +%s)
run: docker build docker --file docker/Dockerfile --tag ${{ github.repository }}:$(date +%s)
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./
env:
DEBUG: true
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ inputs:
default: ""
runs:
using: "docker"
image: "Dockerfile"
image: "docker/Dockerfile"

# Ref: https://haya14busa.github.io/github-action-brandings/
branding:
Expand Down
13 changes: 8 additions & 5 deletions Dockerfile → docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
FROM node:current-alpine

WORKDIR /usr/app

RUN apk --no-cache add git~=2.30 bash~=5.1

ENV REVIEWDOG_VERSION=v0.13.0
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b /usr/local/bin/ ${REVIEWDOG_VERSION}

RUN npm install -g [email protected] [email protected] [email protected]

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x entrypoint.sh
COPY entrypoint.sh package.json package-lock.json ./
RUN chmod +x entrypoint.sh && \
npm install && \
rm package*.json && \
npx remark-cli --version > /usr/app/remark_version

ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/usr/app/entrypoint.sh"]
13 changes: 10 additions & 3 deletions entrypoint.sh → docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash

if [[ "${DEBUG}" = true ]]; then
echo "[action-remark-lint] Debug flag detected, switching on trace and verbose mode."
set -o xtrace
set +o verbose
fi

set -eu # Increase bash error strictness

if [[ -n "${GITHUB_WORKSPACE}" ]]; then
Expand All @@ -7,7 +14,7 @@ fi

export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

echo "[action-remark-lint] Versions: $(remark --version), remark-lint: $(npm remark-lint --version)"
echo "[action-remark-lint] Versions: $(cat ./remark_version)"

# Install plugins if package.sjon file is present
if [[ -f "package.json" ]]; then
Expand All @@ -17,7 +24,7 @@ fi

# NOTE: ${VAR,,} Is bash 4.0 syntax to make strings lowercase.
echo "[action-remark-lint] Checking markdown code with the remark-lint linter and reviewdog..."
remark --use=remark-preset-lint-recommended . ${INPUT_REMARK_ARGS} 2>&1 |
npx remark-cli --use=remark-preset-lint-recommended . "${INPUT_REMARK_ARGS}" 2>&1 |
sed 's/\x1b\[[0-9;]*m//g' | # Removes ansi codes see https://github.com/reviewdog/errorformat/issues/51
reviewdog -f=remark-lint \
-name="${INPUT_TOOL_NAME}" \
Expand All @@ -26,4 +33,4 @@ remark --use=remark-preset-lint-recommended . ${INPUT_REMARK_ARGS} 2>&1 |
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \
-level="${INPUT_LEVEL}" \
-tee \
${INPUT_REVIEWDOG_FLAGS}
"${INPUT_REVIEWDOG_FLAGS}"
Loading