Skip to content

Commit b357a2c

Browse files
authored
Update sync-dev-to-stage.yml
1 parent f7a99c6 commit b357a2c

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/sync-dev-to-stage.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,34 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v2
1515

16-
- name: Sync Branches
16+
- name: Create auto-merge Label (if missing)
17+
uses: actions-ecosystem/action-create-label@v1
18+
with:
19+
github_token: ${{ secrets.PERSONAL_TOKEN }}
20+
label: auto-merge
21+
color: '#0e8a16'
22+
description: 'Auto-merge PRs with this label'
23+
24+
- name: Sync Branches (Create PR)
1725
uses: tretuna/sync-branches@1.4.0
1826
with:
1927
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
2028
FROM_BRANCH: 'dev'
2129
TO_BRANCH: 'stage'
30+
PULL_REQUEST_TITLE: "Sync dev to stage"
31+
PULL_REQUEST_BODY: "Automated PR to sync dev to stage."
32+
PULL_REQUEST_LABELS: "auto-merge"
33+
34+
auto-merge:
35+
runs-on: ubuntu-latest
36+
needs: sync-branches
37+
38+
steps:
39+
- name: Auto-Merge PR
40+
uses: peter-evans/merge-pull-request@v3
41+
with:
42+
token: ${{ secrets.PERSONAL_TOKEN }}
43+
merge-method: squash # Change to merge, squash, or rebase
44+
labels: auto-merge
45+
commit-title: "Auto-merged dev into stage"
46+
commit-message: "Automatically merged PR from dev to stage."

0 commit comments

Comments
 (0)