-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (38 loc) · 1.52 KB
/
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
name: Sync with H7
on:
push:
branches: [gh-workflows]
# "Scheduled workflows run on the latest commit on the default or base branch."
# However, this workflow is not on the default branch, so it does not actually run automatically.
schedule:
- cron: '8 */6 * * *'
# "To trigger the workflow_dispatch event, your workflow must be in the default branch."
# However, this workflow is not in the default branch.
# The following command may be used to run this workflow manually:
# gh workflow run sync.yml --repo OpenDRR/h7-framework --ref gh-workflows
# which the scheduled sync.yml workflow at OpenDRR/h7-riskprofiler does use to trigger this workflow.
workflow_dispatch:
jobs:
sync-with-h7:
runs-on: ubuntu-latest
steps:
- name: "Checkout our own repo: OpenDRR/h7-framework"
uses: actions/checkout@v3
with:
ref: riskprofiler
token: ${{ secrets.GH_PAT }}
fetch-depth: 0
- name: Fetch and merge latest commits from upstream, and push to GitHub
run: |
set -x
git config checkout.defaultRemote origin
git config user.name github-actions
git config user.email [email protected]
git remote add upstream ${{ secrets.UPSTREAM_GIT_REPO }}
git fetch upstream --tags
git switch riskprofiler
git merge --ff-only upstream/riskprofiler
git switch master
git merge --ff-only upstream/master
git push origin --all
git push origin --tags