Skip to content

Commit 5ee93c3

Browse files
authored
chore: update GitHub Action to automatically merge develop into open PRs (#1273)
1 parent 9b3939e commit 5ee93c3

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/rebase-prs-with-develop.yml renamed to .github/workflows/update-prs-with-develop.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rebase PRs with develop
1+
name: Update PRs with develop
22

33
on:
44
push:
@@ -20,7 +20,7 @@ jobs:
2020
git config --global user.name "github-actions[bot]"
2121
git config --global user.email "github-actions[bot]@users.noreply.github.com"
2222
23-
- name: Rebase all open non-Dependabots PRs with develop branch as base
23+
- name: Merge develop into all open non-Dependabot PRs
2424
env:
2525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2626
run: |
@@ -32,14 +32,14 @@ jobs:
3232
gh pr checkout $pr
3333
git fetch origin develop
3434
35-
# Attempt rebase
36-
if git rebase origin/develop; then
37-
echo "PR #$pr rebased successfully. Pushing changes..."
38-
git push --force-with-lease
35+
# Attempt merge
36+
if git merge --no-edit origin/develop; then
37+
echo "PR #$pr merged successfully. Pushing changes..."
38+
git push
3939
else
40-
echo "Conflict in PR #$pr. Rebase aborted."
41-
git rebase --abort
40+
echo "Conflict in PR #$pr. Merge aborted."
41+
git merge --abort
4242
# Optional: Notify author
43-
gh pr comment $pr --body "⚠️ Automatic rebase failed due to conflicts. Please rebase manually."
43+
gh pr comment $pr --body "⚠️ Automatic merge of \`develop\` into this PR failed due to conflicts. Please resolve the conflicts and update your branch."
4444
fi
4545
done

0 commit comments

Comments
 (0)