forked from wukongdaily/RunFilesBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (34 loc) · 1.06 KB
/
Copy pathsync-upstream.yml
File metadata and controls
43 lines (34 loc) · 1.06 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
41
42
43
name: Sync upstream changes
on:
schedule:
- cron: "17 3 * * *"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: sync-upstream
cancel-in-progress: true
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout fork
uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
- name: Merge upstream master
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote add upstream https://github.com/wukongdaily/RunFilesBuilder.git
git fetch --prune upstream master
if git merge-base --is-ancestor upstream/master HEAD; then
echo "Fork already contains upstream/master"
exit 0
fi
if ! git merge --no-edit upstream/master; then
git merge --abort
echo "::error::Upstream changes conflict with local fixes; resolve the merge manually."
exit 1
fi
git push origin HEAD:master