-
Notifications
You must be signed in to change notification settings - Fork 17
47 lines (38 loc) · 1.17 KB
/
auto-sync-master-with-develop.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
name: Auto Sync Master with Develop
on:
push:
branches:
- develop
permissions:
contents: write
jobs:
sync-branches:
if: "startsWith(github.event.head_commit.message, '[RELEASE]')"
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.AUTO_SYNC_BRANCHES_APP_ID }}
private-key: ${{ secrets.AUTO_SYNC_BRANCHES_SECRET }}
- name: Checkout Develop
uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Checkout Master and Fast-Forward Merge
run: |
git checkout develop
git fetch origin
git checkout master
git pull
git merge --ff-only origin/develop
- name: Push Changes to Master
run: git push origin master --force-with-lease
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}