Skip to content

Commit

Permalink
add: package_manager option
Browse files Browse the repository at this point in the history
  • Loading branch information
Khsmty committed Oct 18, 2023
1 parent bc558ff commit 6d058a5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
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'
9 changes: 9 additions & 0 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ echo '::endgroup::'
echo '::group:: Installing textlint ... https://github.com/textlint/textlint'
if [ -x "./node_modules/.bin/textlint" ]; then
echo 'already installed'
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 'npm ci start'
npm ci
Expand Down

0 comments on commit 6d058a5

Please sign in to comment.