From 19648b15c53a3eb9348d992b36305e3ccd953262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Fri, 24 Feb 2023 18:08:34 +0300 Subject: [PATCH] feat(action): Add extra args input to action --- .github/workflows/test-action.yml | 1 + action.yml | 5 +++++ docker/entrypoint.sh | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index f10ac156..6db9b78d 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -25,4 +25,5 @@ jobs: - name: Run Committed uses: ./ with: + args: "-vv --no-merge-commit" commits: "HEAD~..HEAD^2" diff --git a/action.yml b/action.yml index eef2bd87..c1c53ee9 100644 --- a/action.yml +++ b/action.yml @@ -3,6 +3,10 @@ author: "Ed Page" description: "Run committed to check commit history" inputs: + args: + description: "arguments for committed" + required: false + default: "" commits: description: "commit range to check" required: false @@ -12,6 +16,7 @@ runs: using: "docker" image: "docker/Dockerfile" args: + - ${{ inputs.args }} - ${{ inputs.commits }} branding: diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 064db768..5288b642 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -7,6 +7,7 @@ log() { } CMD_NAME="committed" +args=$(echo "${@:1:$#-1}" | xargs) commits="${@: -1}" if [[ -z $(which ${CMD_NAME} 2>/dev/null) ]]; then @@ -26,4 +27,4 @@ echo "" echo "If this fails, don't sweat it. We're trying to encourage clear communication and not hinder contributions." echo "If it is a reasonable issue and you lack time or feel uncomfortable fixing it yourself," echo "let us know and we can mentor or fix it." -${COMMAND} --color=always -vv "${commits}" +${COMMAND} --color=always -vv "${args}" "${commits}"