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 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