-
-
Notifications
You must be signed in to change notification settings - Fork 98
43 lines (39 loc) · 1.24 KB
/
auto_merge.yml
File metadata and controls
43 lines (39 loc) · 1.24 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: auto_merge
on:
workflow_dispatch:
schedule:
- cron: 0 8 * * fri
# cron表达式,每周五16点执行一次,actions任务时区为UTC时区。
jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0
lfs: true
- name: Set git identity
run : |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Load upstream commits
run: |
git update-index --assume-unchanged ./src/main/resources/config.json
git pull https://github.com/JunzhouLiu/BILIBILI-HELPER.git --log --no-commit
- name: Apply commit changes
run: |
if [ -f ./.git/MERGE_MSG ]; then
mkdir ./tmp && cp ./.git/MERGE_MSG ./tmp/message
sed -i "1c [bot] AutoMerging: merge all upstream's changes:" ./tmp/message
sed -i '/^\#.*/d' ./tmp/message
git commit --file="./tmp/message"
else
echo "There is no merge commits."
fi
- name: Push Commits
env:
DOWNSTREAM_BRANCH: main
TZ: Asia/Shanghai
run: git push origin $DOWNSTREAM_BRANCH