-
Notifications
You must be signed in to change notification settings - Fork 34
59 lines (48 loc) · 1.3 KB
/
new.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
48
49
50
51
52
53
54
55
56
57
58
59
name: Automatic Commit
on:
# push推送时触发
push:
branches:
- master
# 定时任务触发
schedule:
# 每天北京时间1点运行
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: pip install requests wget
- name: Clear old files
env:
TZ: Asia/Shanghai
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git checkout --orphan new_branch
git commit -m "Initial commit on new_branch"
git branch -D master
git branch -m new_branch master
git push --set-upstream origin master -f
- name: Update
run: python ./scripts/tools/adblock.py
- name: Commit
env:
TZ: Asia/Shanghai
run: |
git add -A
git commit -m \
":pencil: Update at \
$(date +"%Y-%m-%d %H:%M") \
"
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PRIVATE_TOKEN }}