forked from mendix/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.13 KB
/
sync.yml
File metadata and controls
40 lines (33 loc) · 1.13 KB
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
name: Sync Docs Fork with Upstream
on:
schedule:
# Daily at midnight (UTC).
- cron: '0 0 * * *'
workflow_dispatch: # Allow manual trigger from the GitHub UI.
jobs:
sync:
runs-on: ubuntu-latest
env:
DEFAULT_BRANCH: development
UPSTREAM_REPO_URL: https://github.com/mendix/docs.git
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
fetch-depth: 0
ref: ${{ env.DEFAULT_BRANCH }}
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Add upstream remote and fetch
run: |
git remote add upstream ${{ env.UPSTREAM_REPO_URL }}
git fetch upstream
- name: Merge upstream changes into default branch
run: |
git checkout ${{ env.DEFAULT_BRANCH }}
git merge upstream/${{ env.DEFAULT_BRANCH }} --no-edit
git push origin ${{ env.DEFAULT_BRANCH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}