Skip to content

Commit

Permalink
Merge pull request #87 from tsuyoshicho/update/releasev2series
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuyoshicho authored Oct 21, 2020
2 parents cddb9ed + b1edae1 commit 728c320
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
18 changes: 6 additions & 12 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'}"
Expand Down

0 comments on commit 728c320

Please sign in to comment.