forked from hotosm/tasking-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (79 loc) · 2.54 KB
/
ohm.upstream-sync.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: OHM Upstream Sync
on:
push:
branches: 885-ci-for-tasking-manager
# schedule:
# - cron: '34 12 * * *'
workflow_dispatch:
jobs:
upstream-sync:
name: Upstream Sync
permissions:
contents: write
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Check out our repository
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fetch-depth: 0
- name: List all branches
run: |
git branch --all | egrep 'main|master|sacrifice|candidate'
- name: Delete previous sacrificial branch
run: |
if git show-ref --quiet refs/heads/release-candidate; then
git branch --remote -D origin/release-candidate
fi
if git show-ref --quiet refs/heads/the-sacrifice; then
git branch --remote -D origin/the-sacrifice
fi
- name: List all branches
run: |
git branch --all | egrep 'main|master|sacrifice|candidate'
- name: Check out upstream master
env:
UPSTREAM: https://github.com/tyrasd/overpass-turbo
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git remote add upstream '${UPSTREAM}'
git fetch upstream master
- name: List all branches
run: |
git branch --all | egrep 'main|master|sacrifice|candidate'
- name: Create 'release-candidate', our new sacrificial branch
uses: peterjgrainger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: 'the-sacrifice'
- name: Check out our new sacrificial branch
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
ref: 'the-sacrifice'
fetch-depth: 0
- name: List all branches
run: |
git branch --all | egrep 'main|master|sacrifice|candidate'
# - name: Make our scripts executable
# run: chmod +x ./scripts/*.sh
# - name: Preserve upstream docs
# run: ./scripts/preserve_upstream_docs.sh
#
# - name: Start the merge
# run: |
# git merge --no-ff --no-commit upstream/master
# git status
# - name: Continue the merge where there are no concerns
# run: ./scripts/upstream_sync.sh
#
# - name: Push updates
# run: |
# git push release-candidate