forked from openjdk/jdk
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.28 KB
/
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
# .github/workflows/sync-upstream.yml
name: Sync Upstream
on:
schedule:
- cron: '0 */3 * * *' # Runs every 3 hours
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Pull latest changes from upstream
run: |
set -x
git config --global user.email "[email protected]"
git config --global user.name "Datadog Syncup Service"
git config --global checkout.defaultRemote "origin"
git remote add upstream https://github.com/openjdk/jdk.git
git fetch upstream
git checkout upstream_base
git checkout -b upstream-master upstream/master
git checkout upstream_base
git merge upstream/master
git checkout master
git merge --ff --no-commit upstream/master
git add .
git commit -m "Sync upstream" || true
- name: Push changes to upstream_base
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_PAT }}
branch: upstream_base
- name: Push changes to master
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GH_PAT }}
branch: master