Skip to content

Commit 04a4045

Browse files
committed
feat: add auto-merge for version sync PRs
- Enable auto-merge for main → develop sync PRs - Enable auto-merge for main → staging sync PRs - Automatically merge version synchronization to keep branches in sync - Uses --auto --merge flags to merge when all checks pass
1 parent fb39cde commit 04a4045

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/update-version.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,19 @@ jobs:
169169
echo "*This PR was automatically created by the version update workflow*"
170170
} > pr-body.md
171171
172-
gh pr create \
172+
PR_URL=$(gh pr create \
173173
--base develop \
174174
--head $SYNC_BRANCH \
175175
--title "🔄 Sync: main → develop (v$VERSION)" \
176176
--body-file pr-body.md \
177-
--label "auto-updated"
177+
--label "auto-updated")
178+
179+
# Extract PR number from URL
180+
PR_NUMBER=$(echo $PR_URL | grep -oE '[0-9]+$')
181+
182+
# Enable auto-merge
183+
echo "Enabling auto-merge for PR #$PR_NUMBER..."
184+
gh pr merge $PR_NUMBER --auto --merge
178185
env:
179186
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
180187

@@ -216,12 +223,19 @@ jobs:
216223
echo "*This PR was automatically created by the version update workflow*"
217224
} > pr-body-staging.md
218225
219-
gh pr create \
226+
PR_URL=$(gh pr create \
220227
--base staging \
221228
--head $SYNC_BRANCH \
222229
--title "🔄 Sync: main → staging (v$VERSION)" \
223230
--body-file pr-body-staging.md \
224-
--label "auto-updated"
231+
--label "auto-updated")
232+
233+
# Extract PR number from URL
234+
PR_NUMBER=$(echo $PR_URL | grep -oE '[0-9]+$')
235+
236+
# Enable auto-merge
237+
echo "Enabling auto-merge for PR #$PR_NUMBER..."
238+
gh pr merge $PR_NUMBER --auto --merge
225239
env:
226240
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
227241

0 commit comments

Comments
 (0)