generated from mateusfg7/nextjs-setup
-
Notifications
You must be signed in to change notification settings - Fork 11
60 lines (51 loc) · 1.57 KB
/
sync-dev-branch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: 'Sync dev branch'
on:
workflow_call:
workflow_dispatch:
jobs:
create-sync-pr:
runs-on: ubuntu-latest
name: Sync dev branch
outputs:
PULL_REQUEST_NUMBER: ${{ steps.pull.outputs.PULL_REQUEST_NUMBER }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Opening pull request
id: pull
uses: tretuna/[email protected]
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
FROM_BRANCH: "main"
TO_BRANCH: "dev"
PULL_REQUEST_TITLE: "chore(git): merge `main` into `dev`"
CONTENT_COMPARISON: true
PULL_REQUEST_AUTO_MERGE_METHOD: "merge"
# merge-pr:
# runs-on: ubuntu-latest
# name: Merge PR
# needs: create-sync-pr
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Merge PR
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PULL_REQUEST_NUMBER: ${{needs.create-sync-pr.outputs.PULL_REQUEST_NUMBER}}
# run: gh pr merge $PULL_REQUEST_NUMBER --merge
add-automerge-label:
runs-on: ubuntu-latest
name: Add "automerge" label
needs: create-sync-pr
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add "automerge" label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_NUMBER: ${{needs.create-sync-pr.outputs.PULL_REQUEST_NUMBER}}
run: gh pr edit $PULL_REQUEST_NUMBER --add-label automerge