Skip to content

Commit c6a7f25

Browse files
authored
Update force-push.yml
1 parent 5f8a869 commit c6a7f25

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/force-push.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Merge PR into main (prefer PR changes)
1+
name: Merge PR into main (force PR changes)
22

33
on:
44
workflow_dispatch:
@@ -7,7 +7,7 @@ permissions:
77
contents: write
88

99
jobs:
10-
merge-prefer-pr:
10+
merge-force-pr:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout repository
@@ -37,9 +37,9 @@ jobs:
3737
git config user.name "github-actions[bot]"
3838
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
3939
40-
- name: Merge PR branch into main
40+
- name: Force main to PR branch
4141
run: |
4242
git fetch origin
43-
git checkout main
44-
git merge -s recursive -X theirs origin/${{ steps.check.outputs.branch }} || true
45-
git push origin main
43+
git checkout ${{ steps.check.outputs.branch }}
44+
git checkout -B main
45+
git push origin main --force

0 commit comments

Comments
 (0)