diff --git a/action.yml b/action.yml index 00a6617..df958c1 100644 --- a/action.yml +++ b/action.yml @@ -56,7 +56,7 @@ runs: - name: 'Commit and push the changed files' run: | sudo ${{ github.action_path }}/setup-branch.sh ${{ inputs.branch }} - git stage -A ${{ inputs.files }} + sudo git stage -A ${{ inputs.files }} sudo ${{ github.action_path }}/commit.sh "${{ inputs.message }}" ${{ inputs.allow-empty }} sudo ${{ github.action_path }}/push.sh ${{ inputs.branch }} shell: bash diff --git a/setup-branch.sh b/setup-branch.sh index d58cf01..b282319 100755 --- a/setup-branch.sh +++ b/setup-branch.sh @@ -8,6 +8,7 @@ then git switch $1 else git switch --orphan $1 + git rm --cached -r . git commit --allow-empty -m "Initialize branch" fi git merge --squash --strategy-option=theirs --allow-unrelated-histories $work_branch