Skip to content

Commit

Permalink
Merge pull request #353 from Khsmty/master
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuyoshicho authored Oct 18, 2023
2 parents bc558ff + 053e022 commit d35da75
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ Optional. Additional reviewdog flags

textlint arguments (i.e. target dir:`doc/*`)

### `package_manager`

Optional. Package manager used in the repository [npm,yarn,pnpm]
Default is `npm`.

## Customizes

`.textlintrc` put in your repo.
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ inputs:
tool_name:
description: 'Tool name to use for reviewdog reporter'
default: 'textlint'
package_manager:
description: 'Package manager used in the repository'
default: 'npm'
runs:
using: 'composite'
steps:
Expand All @@ -52,6 +55,7 @@ runs:
INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }}
INPUT_TEXTLINT_FLAGS: ${{ inputs.textlint_flags }}
INPUT_TOOL_NAME: ${{ inputs.tool_name }}
INPUT_PACKAGE_MANAGER: ${{ inputs.package_manager }}
branding:
icon: 'alert-octagon'
color: 'blue'
12 changes: 11 additions & 1 deletion script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,19 @@ echo '::endgroup::'
echo '::group:: Installing textlint ... https://github.com/textlint/textlint'
if [ -x "./node_modules/.bin/textlint" ]; then
echo 'already installed'
else
elif [[ "${INPUT_PACKAGE_MANAGER}" == "npm" ]]; then
echo 'npm ci start'
npm ci
elif [[ "${INPUT_PACKAGE_MANAGER}" == "yarn" ]]; then
echo 'yarn install start'
yarn install
elif [[ "${INPUT_PACKAGE_MANAGER}" == "pnpm" ]]; then
echo 'pnpm install start'
pnpm install
else
echo 'The specified package manager is not supported.'
echo '::endgroup::'
exit 1
fi

if [ -x "./node_modules/.bin/textlint" ]; then
Expand Down

0 comments on commit d35da75

Please sign in to comment.