From a6fe15750e55bbe409c35528d3ed0baf4839e7ed Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Sat, 17 Oct 2020 15:35:24 +0900 Subject: [PATCH 1/8] doc: Update README --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5566cb3..36ef90e 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ ## IMPORTANT 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___. +___v2 series support npm v7 or later___. +___IF use with npm later less than v7, please used v1 series___. ## detail @@ -67,20 +67,24 @@ jobs: - uses: actions/checkout@v2 with: submodules: true + - name: Setup node/npm + uses: actions/setup-node@v2 + with: + node-version: '15' # node v15 with npm v7 - 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 From c81065ddb9bd6b56c70cfb1b3927d687ce92f4c8 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Sat, 17 Oct 2020 15:48:39 +0900 Subject: [PATCH 2/8] fix: option and process fixing --- README.md | 4 ---- action.yml | 4 ---- entrypoint.sh | 18 ++++++------------ 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 36ef90e..fc632e3 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,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. 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..d42c4cf 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 0 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'}" From a13ef3e822f18b9e7579834bbdac1edb5be7cbce Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Sat, 17 Oct 2020 16:00:10 +0900 Subject: [PATCH 3/8] fix: update workflow for new --- .github/workflows/reviewdog.yml | 4 ++++ README.md | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 84cafb1..497dc9e 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 + with: + node-version: '15' # node v15 with npm v7 - name: textlint-github-pr-check uses: tsuyoshicho/action-textlint@master with: diff --git a/README.md b/README.md index fc632e3..a150ccb 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,8 @@ 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 From 9463870fa577ae1894ed967749bc8c3e27804998 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Sat, 17 Oct 2020 16:02:26 +0900 Subject: [PATCH 4/8] doc: README more update --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index a150ccb..08d4725 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@ ## IMPORTANT NOTICE action-textlint use textlint within npm ecosystem. -___v2 series support npm v7 or later___. -___IF use with npm later less than v7, please used v1 series___. +___v2 series support npm v7___. ## detail From e47af03bc5f0013cc4e0c01a6259c276cb0ac3b9 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Sat, 17 Oct 2020 16:04:14 +0900 Subject: [PATCH 5/8] fix: node@v2-beta using(temp) --- .github/workflows/reviewdog.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 497dc9e..01c04c7 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -10,7 +10,7 @@ jobs: with: submodules: true - name: Setup node/npm - uses: actions/setup-node@v2 + uses: actions/setup-node@v2-beta with: node-version: '15' # node v15 with npm v7 - name: textlint-github-pr-check diff --git a/README.md b/README.md index 08d4725..54a971f 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ jobs: with: submodules: true - name: Setup node/npm - uses: actions/setup-node@v2 + uses: actions/setup-node@v2-beta with: node-version: '15' # node v15 with npm v7 - name: textlint-github-pr-check From 7f9ce2a0be24e57701619145f5ed3c68a51822f0 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Sun, 18 Oct 2020 09:45:50 +0900 Subject: [PATCH 6/8] fix document / workflow --- .github/workflows/reviewdog.yml | 4 ++-- README.md | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 01c04c7..3972846 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -10,9 +10,9 @@ jobs: with: submodules: true - name: Setup node/npm - uses: actions/setup-node@v2-beta + uses: actions/setup-node@v2-beta # @v2 is not available yet with: - node-version: '15' # node v15 with npm v7 + node-version: '14' # '15' is not available yet - name: textlint-github-pr-check uses: tsuyoshicho/action-textlint@master with: diff --git a/README.md b/README.md index 54a971f..f414e32 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ # GitHub Action: Run textlint with reviewdog -## IMPORTANT NOTICE +## notice action-textlint use textlint within npm ecosystem. -___v2 series support npm v7___. ## detail @@ -64,9 +63,9 @@ jobs: with: submodules: true - name: Setup node/npm - uses: actions/setup-node@v2-beta + uses: actions/setup-node@v2-beta # @v2 is not available yet with: - node-version: '15' # node v15 with npm v7 + node-version: '14' # '15' is not available yet - name: textlint-github-pr-check uses: tsuyoshicho/action-textlint@v2 with: From 4930fa28e2a99e3b2e0da17279f6acc884fc1226 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Wed, 21 Oct 2020 14:39:04 +0900 Subject: [PATCH 7/8] test and worksample use for node 15 --- .github/workflows/reviewdog.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 3972846..4d068cc 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -12,7 +12,7 @@ jobs: - name: Setup node/npm uses: actions/setup-node@v2-beta # @v2 is not available yet with: - node-version: '14' # '15' is not available yet + node-version: '15' - name: textlint-github-pr-check uses: tsuyoshicho/action-textlint@master with: diff --git a/README.md b/README.md index f414e32..b78ed21 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ jobs: - name: Setup node/npm uses: actions/setup-node@v2-beta # @v2 is not available yet with: - node-version: '14' # '15' is not available yet + node-version: '15' - name: textlint-github-pr-check uses: tsuyoshicho/action-textlint@v2 with: From b1edae12c8092d3ac79ffa7715ad4a7fae245e60 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Wed, 21 Oct 2020 14:41:19 +0900 Subject: [PATCH 8/8] when non textlint env, error it --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index d42c4cf..0b9611c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,7 +11,7 @@ if npm ls textlint &> /dev/null; then # pass else echo This repository was not configured for textlint, process done. - exit 0 + exit 1 fi npx textlint -f checkstyle "${INPUT_TEXTLINT_FLAGS:-.}" \