-
Notifications
You must be signed in to change notification settings - Fork 775
47 lines (41 loc) · 1.08 KB
/
rebase-3.0.x-devel.yaml
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: rebase-3.0.x-devel-master
on:
schedule:
- cron: '0 0 * * *'
# scheduled every midnight
workflow_dispatch:
#manual run of the workflow job
jobs:
rebase-branches:
name: Rebase 3.0.x-devel branch HEAD with master current branch
runs-on: ubuntu-latest
steps:
# Step 1: checkout action
- name: Checkout target repo
uses: eProsima/eProsima-CI/external/checkout@v0
with:
ref: 3.0.x-devel
fetch-depth: 0
persist-credentials: true
# Step 2: Set git config
- name: Set git config
id: config
run: |
git config --local user.email "ricardogonzalez@eprosima.com"
git config --local user.name "richiprosima"
shell: bash
# Step 3: Rebase
- name: Rebase current branch
id: rebase_master
run: |
git fetch origin master
git rebase origin/master
shell: bash
# Step 4: Push
- name: Force push if required
id: push
run: |
if [ "$(git status | grep 'diverged\|ahead')" ]; then
git push -f
fi;
shell: bash