Skip to content

Commit

Permalink
Merge pull request #12 from shogo82148/find-command
Browse files Browse the repository at this point in the history
resolve the conflict of #5
  • Loading branch information
shogo82148 committed May 8, 2020
2 parents 1371def + 1bd247c commit 5e6f911
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code.
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: misspell
uses: reviewdog/action-misspell@v1
uses: ./
with:
github_token: ${{ secrets.github_token }}
locale: "US"
pattern: "*.md"
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ It's the same as the `-reporter` flag of reviewdog.

Optional. Ignore (`-i`) a list of comma-separated words. [`armor`] / [`armor,color`].

### `path`

Optional. Base directory to run misspell. Same as `[path]` of `find` command. Default: `.`

### `pattern`

Optional. File patterns of target files. Same as `-name [pattern]` of `find` command. Default: `*`

### `exclude`

Optional. Exclude patterns of target files. Same as `-not -path [exclude]` of `find` command.
e.g. `.git/*`

## Example usage

### [.github/workflows/reviewdog.yml](.github/workflows/reviewdog.yml)
Expand Down
15 changes: 9 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ inputs:
ignore:
description: 'Comma-separated words to ignore'
default: ''
path:
description: "Base directory to run misspell. Same as `[path]` of `find` command."
default: '.'
pattern:
description: "File patterns of target files. Same as `-name [pattern]` of `find` command."
default: '*'
exclude:
description: "Exclude patterns of target files. Same as `-not -path [exclude]` of `find` command."
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.github_token }}
- ${{ inputs.locale }}
- ${{ inputs.level }}
- ${{ inputs.reporter }}
- ${{ inputs.ignore }}
branding:
icon: 'edit'
color: 'gray-dark'
5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ cd "$GITHUB_WORKSPACE" || exit 1

export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

misspell -error -locale="${INPUT_LOCALE}" -i "${INPUT_IGNORE}" . |
reviewdog -efm="%f:%l:%c: %m" -name="misspell" -reporter="${INPUT_REPORTER:-github-pr-check}" -level="${INPUT_LEVEL}"
find "${INPUT_PATH:-'.'}" -not -path "${INPUT_EXCLUDE}" -type f -name "${INPUT_PATTERN:-'*'}" -print0 \
| xargs -0 misspell -locale="${INPUT_LOCALE}" -i "${INPUT_IGNORE}" \
| reviewdog -efm="%f:%l:%c: %m" -name="misspell" -reporter="${INPUT_REPORTER:-github-pr-check}" -level="${INPUT_LEVEL}"

0 comments on commit 5e6f911

Please sign in to comment.