From 8fb5240443a6670d62311a13b8b3e6a8a110c283 Mon Sep 17 00:00:00 2001 From: amousavigourabi <28668597+amousavigourabi@users.noreply.github.com> Date: Thu, 17 Aug 2023 04:50:09 +0200 Subject: [PATCH 1/2] Fix comparison operator --- commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit.sh b/commit.sh index 2325199..d71baed 100755 --- a/commit.sh +++ b/commit.sh @@ -1,5 +1,5 @@ #!/bin/sh -if [ "$2" == "true" ] || ! git diff --cached --quiet --exit-code +if [ "$2" = "true" ] || ! git diff --cached --quiet --exit-code then git commit --allow-empty -m "$1" fi From 68f49568e2b6c93abcc728f11e40ddb22d0c12a2 Mon Sep 17 00:00:00 2001 From: amousavigourabi <28668597+amousavigourabi@users.noreply.github.com> Date: Thu, 17 Aug 2023 04:55:28 +0200 Subject: [PATCH 2/2] Sudo commit.sh --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e926c4f..00a6617 100644 --- a/action.yml +++ b/action.yml @@ -57,6 +57,6 @@ runs: run: | sudo ${{ github.action_path }}/setup-branch.sh ${{ inputs.branch }} git stage -A ${{ inputs.files }} - ${{ github.action_path }}/commit.sh "${{ inputs.message }}" ${{ inputs.allow-empty }} + sudo ${{ github.action_path }}/commit.sh "${{ inputs.message }}" ${{ inputs.allow-empty }} sudo ${{ github.action_path }}/push.sh ${{ inputs.branch }} shell: bash