Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add properties_file option #19

Merged
merged 1 commit into from
Feb 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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