From c0ad5a824ac997b413a605d9eadf9f4e9207be4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=93=D0=BE=D1=80=D0=B4?= =?UTF-8?q?=D0=B8=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Sun, 29 Oct 2023 01:57:27 +0600 Subject: [PATCH 1/2] fix: enhance protolint_flags option * Resolved argument handling in protolint_flags option * Uses .protolint.yaml if present * Updated README.md Closes #3 --- README.md | 1 + entrypoint.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 095f07e..2419bc1 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ [![action-bumpr supported](https://img.shields.io/badge/bumpr-supported-ff69b4?logo=github&link=https://github.com/haya14busa/action-bumpr)](https://github.com/haya14busa/action-bumpr) This GitHub Action runs [protolint](https://github.com/yoheimuta/protolint) with [reviewdog](https://github.com/reviewdog/reviewdog). +By default, action-protolint uses the `.protolint.yaml` configuration file if it exists. ## Usage ```yaml diff --git a/entrypoint.sh b/entrypoint.sh index 87429bc..d29a768 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,9 +12,16 @@ if ! [ -f "protolint" ]; then tar zxf protolint_"${INPUT_PROTOLINT_VERSION}"_Linux_x86_64.tar.gz fi +# Check if .protolint.yaml exists and -config_path is not already set +if [ -f ".protolint.yaml" ] && [[ ! "${INPUT_PROTOLINT_FLAGS}" =~ "-config_path" ]]; then + DEFAULT_CONFIG="-config_path=.protolint.yaml" +else + DEFAULT_CONFIG="" +fi + export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" -./protolint "${INPUT_PROTOLINT_FLAGS}" 2>&1 \ +./protolint ${DEFAULT_CONFIG} ${INPUT_PROTOLINT_FLAGS} 2>&1 \ | reviewdog -efm="[%f:%l:%c] %m" \ -name="linter-name (protolint)" \ -reporter="${INPUT_REPORTER:-github-pr-check}" \ From 27547004244e1c96a587d974af701b9a2e8c0c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=93=D0=BE=D1=80=D0=B4?= =?UTF-8?q?=D0=B8=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Sun, 29 Oct 2023 14:01:04 +0600 Subject: [PATCH 2/2] fix: remove unnecessary .protolint.yaml check Closes #3 --- README.md | 1 - entrypoint.sh | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index 2419bc1..095f07e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ [![action-bumpr supported](https://img.shields.io/badge/bumpr-supported-ff69b4?logo=github&link=https://github.com/haya14busa/action-bumpr)](https://github.com/haya14busa/action-bumpr) This GitHub Action runs [protolint](https://github.com/yoheimuta/protolint) with [reviewdog](https://github.com/reviewdog/reviewdog). -By default, action-protolint uses the `.protolint.yaml` configuration file if it exists. ## Usage ```yaml diff --git a/entrypoint.sh b/entrypoint.sh index d29a768..546e6c8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,16 +12,9 @@ if ! [ -f "protolint" ]; then tar zxf protolint_"${INPUT_PROTOLINT_VERSION}"_Linux_x86_64.tar.gz fi -# Check if .protolint.yaml exists and -config_path is not already set -if [ -f ".protolint.yaml" ] && [[ ! "${INPUT_PROTOLINT_FLAGS}" =~ "-config_path" ]]; then - DEFAULT_CONFIG="-config_path=.protolint.yaml" -else - DEFAULT_CONFIG="" -fi - export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" -./protolint ${DEFAULT_CONFIG} ${INPUT_PROTOLINT_FLAGS} 2>&1 \ +./protolint ${INPUT_PROTOLINT_FLAGS} 2>&1 \ | reviewdog -efm="[%f:%l:%c] %m" \ -name="linter-name (protolint)" \ -reporter="${INPUT_REPORTER:-github-pr-check}" \