Skip to content

Commit

Permalink
Add properties_file option (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
tochi-y committed Feb 14, 2021
1 parent f53e0ef commit 755b0a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Default is 'reviewdog'.
### `workdir`
Optional. Working directory relative to the root directory.

### `properties_file`
Optional. Properties file relative to the root directory.

## Example usage

Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ inputs:
tool_name:
description: 'Tool name to use for reviewdog reporter'
default: 'reviewdog'
properties_file:
description: 'Properties file relative to the root directory.'
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
6 changes: 5 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ echo "Running check"

export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

exec java -jar /checkstyle.jar "${INPUT_WORKDIR}" -c "${INPUT_CHECKSTYLE_CONFIG}" -f xml \
if [ -n "${INPUT_PROPERTIES_FILE}" ]; then
OPT_PROPERTIES_FILE="-p ${INPUT_PROPERTIES_FILE}"
fi

exec java -jar /checkstyle.jar "${INPUT_WORKDIR}" -c "${INPUT_CHECKSTYLE_CONFIG}" ${OPT_PROPERTIES_FILE} -f xml \
| reviewdog -f=checkstyle \
-name="${INPUT_TOOL_NAME}" \
-reporter="${INPUT_REPORTER:-github-pr-check}" \
Expand Down

0 comments on commit 755b0a5

Please sign in to comment.