diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 84cafb1..4d068cc 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -9,6 +9,10 @@ jobs: uses: actions/checkout@v2 with: submodules: true + - name: Setup node/npm + uses: actions/setup-node@v2-beta # @v2 is not available yet + with: + node-version: '15' - name: textlint-github-pr-check uses: tsuyoshicho/action-textlint@master with: diff --git a/README.md b/README.md index 5566cb3..b78ed21 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ # GitHub Action: Run textlint with reviewdog -## IMPORTANT NOTICE +## notice action-textlint use textlint within npm ecosystem. -___v1 series support npm less than v7___. -___IF use with npm v7 or later, please used v2 series___. ## detail @@ -43,10 +41,6 @@ github-pr-review can use Markdown and add a link to rule page in reviewdog repor textlint arguments (i.e. target dir:`doc/*`) -### `textlint_version` - -if textlint do not contain in project, use this version. - ## Customizes `.textlintrc` put in your repo. @@ -64,23 +58,28 @@ jobs: name: runner / textlint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 with: submodules: true + - name: Setup node/npm + uses: actions/setup-node@v2-beta # @v2 is not available yet + with: + node-version: '15' - name: textlint-github-pr-check - uses: tsuyoshicho/action-textlint@v1 + uses: tsuyoshicho/action-textlint@v2 with: github_token: ${{ secrets.github_token }} reporter: github-pr-check textlint_flags: "doc/**" - name: textlint-github-check - uses: tsuyoshicho/action-textlint@v1 + uses: tsuyoshicho/action-textlint@v2 with: github_token: ${{ secrets.github_token }} reporter: github-check textlint_flags: "doc/**" - name: textlint-github-pr-review - uses: tsuyoshicho/action-textlint@v1 + uses: tsuyoshicho/action-textlint@v2 with: github_token: ${{ secrets.github_token }} reporter: github-pr-review diff --git a/action.yml b/action.yml index 1476431..d61ca69 100644 --- a/action.yml +++ b/action.yml @@ -20,10 +20,6 @@ inputs: description: "flags and args of textlint command. Default: '.'" default: '.' required: false - textlint_version: - description: "if textlint do not contain in project, use this version. default:'11.6.3'" - default: '11.6.3' - required: false runs: using: 'docker' image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index 1ee4d84..0b9611c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,23 +4,17 @@ cd "$GITHUB_WORKSPACE" export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" -# nothing command, try project package install +# setup and check. +npm ci if npm ls textlint &> /dev/null; then - # pass : + # pass else - npm install -fi -# nothing command in after install, use command direct install -PACKAGE="" -if npm ls textlint &> /dev/null; then - npx textlint --version -else - PACKAGE="-p textlint@${INPUT_TEXTLINT_VERSION:-11.6.3}" - echo textlint direct install version: ${INPUT_TEXTLINT_VERSION:-11.6.3} + echo This repository was not configured for textlint, process done. + exit 1 fi -npx ${PACKAGE} textlint -f checkstyle "${INPUT_TEXTLINT_FLAGS:-.}" \ +npx textlint -f checkstyle "${INPUT_TEXTLINT_FLAGS:-.}" \ | reviewdog -f=checkstyle -name="textlint" \ -reporter="${INPUT_REPORTER:-'github-pr-check'}" \ -level="${INPUT_LEVEL:-'error'}"