forked from useclassplay/useclassplay.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (33 loc) · 916 Bytes
/
autosync.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
name: Sync with Upstream
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
env:
UPSTREAM_REPO: "useclassplay/useclassplay.github.io"
BRANCH: "main"
defaults:
run:
shell: bash
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Fork Repository
uses: actions/checkout@v3
with:
ref: ${{ env.BRANCH }}
- name: Set Up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Add Upstream Remote
run: |
git remote add upstream https://github.com/${{ env.UPSTREAM_REPO }}.git
git fetch upstream
- name: Sync with Upstream
run: |
git merge upstream/${{ env.BRANCH }} --no-edit || true
- name: Push Changes to Fork
run: |
git push origin ${{ env.BRANCH }}