-
Notifications
You must be signed in to change notification settings - Fork 33
31 lines (31 loc) · 1.06 KB
/
sync-branches.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
name: Sync branches
on:
push:
branches:
- 'master'
- 'development'
jobs:
sync-branch:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'Codeinwp' }} # Disable on forks
steps:
- uses: actions/checkout@master
- name: Retrieve branch name
id: retrieve-branch-name
run: echo "::set-output name=branch_name::$(REF=${GITHUB_HEAD_REF:-$GITHUB_REF} && echo ${REF#refs/heads/} | sed 's/\//-/g')"
- name: Merge master -> development
if: ${{ steps.retrieve-branch-name.outputs.branch_name == 'master' }}
uses: Codeinwp/merge-branch@master
with:
type: now
from_branch: master
target_branch: development
github_token: ${{ secrets.BOT_TOKEN }}
- name: Merge development -> next
if: ${{ steps.retrieve-branch-name.outputs.branch_name == 'development' }}
uses: Codeinwp/merge-branch@master
with:
type: now
from_branch: development
target_branch: next
github_token: ${{ secrets.BOT_TOKEN }}