Skip to content

Commit 4a832d4

Browse files
committed
lets go
1 parent a550783 commit 4a832d4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/actions/push-changes/action.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,13 @@ runs:
4242
git config --global user.name "${{ github.actor }}"
4343
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
4444
git add -- ${{ inputs.working-directory }}
45+
git stash push --keep-index -- ${{ inputs.working-directory }}
4546
- name: Check for changes in ${{ inputs.working-directory }}
4647
shell: bash
4748
run: |
48-
git diff ${{ github.head_ref || github.ref }} origin/${{ inputs.target-branch }} --staged --quiet -- ${{ inputs.working-directory }}
49+
git checkout -b ${{ inputs.target-branch }} origin/${{ inputs.target-branch }} --force
50+
git stash apply
51+
git diff --staged --quiet -- ${{ inputs.working-directory }}
4952
continue-on-error: true
5053
id: check-diff
5154
- name: Push changes to ${{ inputs.target-branch }}, if exists
@@ -57,8 +60,6 @@ runs:
5760
if: ${{ steps.check-diff.outcome == 'failure' }}
5861
shell: bash
5962
run: |
60-
git stash push -- ${{ inputs.working-directory }}
61-
git fetch origin
6263
git checkout -b ${{ inputs.target-branch }} origin/${{ inputs.target-branch }} --force
6364
git stash pop
6465
git commit -m'${{ inputs.commit-message }}' -- ${{ inputs.working-directory }}

0 commit comments

Comments
 (0)