-
Notifications
You must be signed in to change notification settings - Fork 188
55 lines (47 loc) · 1.51 KB
/
update-dev.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
name: update-dev
on:
workflow_run:
workflows:
- Build Website - JSON
types:
- completed
branches:
- master
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
update-dev:
runs-on: ubuntu-latest
if: >-
${{
github.event_name != 'workflow_run' ||
(
github.event_name == 'workflow_run' &&
github.event.workflow_run.event == 'push'
)
}}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.NIGHTLY_TOKEN }}
fetch-depth: 0 # We want entire git-history to avoid any merge conflicts
- name: Nightly Merge
env:
CONFIG_USERNAME: GitHub Nightly Merge Action
CONFIG_EMAIL: [email protected]
MERGE_HEAD: master
MERGE_BASE: dev
MERGE_ARGS: --no-ff --allow-unrelated-histories --no-edit
run: |
# This script is adapted from the robotology/[email protected] GitHub action:
# https://github.com/robotology/gh-action-nightly-merge/blob/master/entrypoint.sh
git config --global user.name "$CONFIG_USERNAME"
git config --global user.email "$CONFIG_EMAIL"
git fetch origin $MERGE_HEAD
(git checkout $MERGE_HEAD && git pull origin $MERGE_HEAD)
git fetch origin $MERGE_BASE
(git checkout $MERGE_BASE && git pull origin $MERGE_BASE)
git merge $MERGE_ARGS $MERGE_HEAD
git push origin $MERGE_BASE