Skip to content

Commit 16addf5

Browse files
authored
ci: Improve gitflow process (#7019)
1 parent 8c0d918 commit 16addf5

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

.github/workflows/gitflow-sync-develop.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ on:
1111
workflow_dispatch:
1212

1313
env:
14-
DEV_BRANCH: develop
14+
SOURCE_BRANCH: master
15+
TAGRET_BRANCH: develop
1516

1617
jobs:
1718
main:
@@ -29,9 +30,10 @@ jobs:
2930
id: open-pr
3031
uses: repo-sync/pull-request@v2
3132
with:
32-
destination_branch: ${{ env.DEV_BRANCH }}
33-
pr_title: '[Gitflow] Merge ${{ github.ref_name }} into ${{ env.DEV_BRANCH }}'
34-
pr_body: 'Merge ${{ github.ref_name }} branch into ${{ env.DEV_BRANCH }}'
33+
source_branch: ${{ env.SOURCE_BRANCH }}
34+
destination_branch: ${{ env.TARGET_BRANCH }}
35+
pr_title: '[Gitflow] Merge ${{ env.SOURCE_BRANCH }} into ${{ env.TARGET_BRANCH }}'
36+
pr_body: 'Merge ${{ env.SOURCE_BRANCH }} branch into ${{ env.TARGET_BRANCH }}'
3537
pr_label: 'Dev: Gitflow'
3638

3739
# https://github.com/marketplace/actions/enable-pull-request-automerge
@@ -44,6 +46,8 @@ jobs:
4446

4547
# https://github.com/marketplace/actions/auto-approve
4648
- name: Auto approve PR
49+
# Always skip this for now, until we got a proper bot setup
50+
if: steps.open-pr.outputs.pr_number != '' || 1 == 2
4751
uses: hmarr/auto-approve-action@v3
4852
with:
4953
pull-request-number: ${{ steps.open-pr.outputs.pr_number }}

.github/workflows/gitflow-sync-master.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
name: Gitflow - Sync develop into master
22
on:
33
push:
4-
branches:
5-
- develop
6-
paths:
7-
# We want to trigger this when ONLY the changlog is changed on develop, but nothing else
8-
- 'CHANGELOG.md'
9-
- '!packages'
10-
- '!**/*.js'
11-
- '!**/*.json'
12-
- '!**/*.ts'
13-
workflow_dispatch:
4+
pull_request:
5+
- types: [closed]
6+
- branches:
7+
- 'develop'
148

159
env:
1610
MAIN_BRANCH: master
@@ -19,6 +13,9 @@ jobs:
1913
main:
2014
name: Create PR develop->master
2115
runs-on: ubuntu-20.04
16+
if: |
17+
github.event.pull_request.merged == true
18+
&& startsWith(github.event.pull_request.title, "meta(changelog):")
2219
permissions:
2320
pull-requests: write
2421
contents: write
@@ -46,6 +43,8 @@ jobs:
4643

4744
# https://github.com/marketplace/actions/auto-approve
4845
- name: Auto approve PR
46+
# Always skip this for now, until we got a proper bot setup
47+
if: steps.open-pr.outputs.pr_number != '' || 1 == 2
4948
uses: hmarr/auto-approve-action@v3
5049
with:
5150
pull-request-number: ${{ steps.open-pr.outputs.pr_number }}

0 commit comments

Comments
 (0)