From fab600b8f1373ce43d3cc65d8a9bfe66bdda4066 Mon Sep 17 00:00:00 2001 From: Matteo Agnoletto <30753195+EPMatt@users.noreply.github.com> Date: Wed, 11 Nov 2020 17:16:39 +0100 Subject: [PATCH 1/3] add support for additional reviewdog flags --- action.yml | 6 ++++++ entrypoint.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 29bd9a8..e1a2606 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,11 @@ inputs: required: false default: 'github-check' + reviewdog_flags: + description: 'Additional reviewdog flags' + required: false + default: '' + runs: using: 'docker' image: 'Dockerfile' @@ -31,6 +36,7 @@ runs: - ${{ inputs.lint_xml_file }} - ${{ inputs.level }} - ${{ inputs.reporter }} + - ${{ inputs.reviewdog_flags }} branding: icon: 'smartphone' diff --git a/entrypoint.sh b/entrypoint.sh index 720235f..aaa7fdf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,4 +3,4 @@ export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" python3 /usr/local/bin/converter.py $GITHUB_WORKSPACE/${INPUT_LINT_XML_FILE} -cat output_checkstyle.xml | reviewdog -f=checkstyle -name="Android Lint" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}" +cat output_checkstyle.xml | reviewdog -f=checkstyle -name="Android Lint" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}" ${INPUT_REVIEWDOG_FLAGS} From 202b9007c3cfddced6f1d080e3758a47477e43a9 Mon Sep 17 00:00:00 2001 From: Matteo Agnoletto <30753195+EPMatt@users.noreply.github.com> Date: Wed, 11 Nov 2020 23:21:53 +0100 Subject: [PATCH 2/3] add support for different severity levels --- converter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/converter.py b/converter.py index 5228c8f..a79faab 100644 --- a/converter.py +++ b/converter.py @@ -34,7 +34,10 @@ else: error.attrib['column'] = str(0) - error.attrib['severity'] = 'error' + if 'severity' in issue.attrib: + error.attrib['severity'] = issue.attrib['severity'] + else: + error.attrib['severity'] = 'info' issueId = issue.attrib['id'] message = issue.attrib['message'] From 67768cbe73f48b9d4d0c4200d842adc464c833f3 Mon Sep 17 00:00:00 2001 From: Matteo Agnoletto <30753195+EPMatt@users.noreply.github.com> Date: Sat, 21 Nov 2020 22:05:50 +0100 Subject: [PATCH 3/3] add reviewdog_flags docs & fix typo --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f30b6d..ffecb55 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # GitHub Action: Run Android Lint with reviewdog -This action runs [Andriod Lint](https://developer.android.com/studio/write/lint) with +This action runs [Android Lint](https://developer.android.com/studio/write/lint) with [reviewdog](https://github.com/reviewdog/reviewdog). ## Inputs @@ -24,6 +24,11 @@ The default is `error`. Optional. Reporter of reviewdog command [`github-check`, `github-pr-check`,`github-pr-review`]. The default is `github-check`. +#### `reviewdog_flags` + +Optional. Additional flags to be passed to reviewdog cli. +The default is ``. + ## Example usage [Example repo](https://github.com/DVDAndroid/action-android-lint-example)