File tree Expand file tree Collapse file tree 5 files changed +70
-6
lines changed
Expand file tree Collapse file tree 5 files changed +70
-6
lines changed Original file line number Diff line number Diff line change 1+ name : Automatic Update
2+
3+ on :
4+ schedule :
5+ - cron : ' 0 0 * * *'
6+ workflow_dispatch :
7+
8+ env :
9+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
10+
11+ concurrency :
12+ group : update
13+ cancel-in-progress : false
14+
15+ jobs :
16+ update :
17+ name : Update Hosts
18+ runs-on : ubuntu-latest
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v3
22+ with :
23+ fetch-depth : 0
24+ - name : Setup git
25+ run : |
26+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
27+ git config --global user.name "github-actions[bot]"
28+ - name : Run update.sh
29+ run : ./update.sh
30+ build :
31+ name : Build
32+ needs : update
33+ runs-on : ubuntu-latest
34+ steps :
35+ - name : Checkout
36+ uses : actions/checkout@v3
37+ with :
38+ fetch-depth : 0
39+ - name : Run compile.sh
40+ run : ./compile.sh
41+ - name : Upload Build Result
42+ uses : actions/upload-artifact@v3
43+ with :
44+ name : MagicalProtection.zip
45+ path : |
46+ MagicalProtection-*.zip
47+ if-no-files-found : error
48+ deploy :
49+ name : Deploy
50+ needs : build
51+ runs-on : ubuntu-latest
52+ steps :
53+ - name : Checkout
54+ uses : actions/checkout@v3
55+ with :
56+ fetch-depth : 0
57+ - name : Setup git
58+ run : |
59+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
60+ git config --global user.name "github-actions[bot]"
61+ - name : Download Build Result
62+ uses : actions/download-artifact@v3
63+ with :
64+ name : MagicalProtection.zip
65+ - name : Run deploy.sh
66+ run : ./deploy.sh
Original file line number Diff line number Diff line change 1111 uses : actions/checkout@v3
1212 with :
1313 fetch-depth : 0
14- - name : Setup git
15- run : |
16- git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
17- git config --global user.name "github-actions[bot]"
1814 - name : Compile
1915 run : ./compile.sh
2016 - name : Upload Result
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Magisk-only completely systemless adblocking.
66[ ![ GitHub Global Download Counter] ( https://img.shields.io/github/downloads/programminghoch10/MagicalProtection/total?logo=github )] ( https://github.com/programminghoch10/MagicalProtection/releases )
77[ ![ GitHub Latest Download Counter] ( https://img.shields.io/github/downloads/programminghoch10/MagicalProtection/latest/total?logo=github )] ( https://github.com/programminghoch10/MagicalProtection/releases/latest ) \
88[ ![ GitHub Build Workflow Status] ( https://img.shields.io/github/actions/workflow/status/programminghoch10/MagicalProtection/build.yml?logo=github%20actions&logoColor=white )] ( https://github.com/programminghoch10/MagicalProtection/actions/workflows/build.yml )
9+ [ ![ GitHub Automatic Update Workflow Status] ( https://img.shields.io/github/actions/workflow/status/programminghoch10/MagicalProtection/autoupdate.yml?logo=github%20actions&logoColor=white )] ( https://github.com/programminghoch10/MagicalProtection/actions/workflows/autoupdate.yml )
910[ ![ GitHub last commit] ( https://img.shields.io/github/last-commit/programminghoch10/MagicalProtection?logo=git&logoColor=white )] ( https://github.com/programminghoch10/MagicalProtection/commits/main ) \
1011[ ![ GitHub Repo stars] ( https://img.shields.io/github/stars/programminghoch10/MagicalProtection?style=social )] ( https://github.com/programminghoch10/MagicalProtection/stargazers ) \
1112[ ![ GitHub followers] ( https://img.shields.io/github/followers/programminghoch10?style=social )] ( https://github.com/programminghoch10 )
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ IFS=$'\n'
66cd " $( dirname " $( readlink -f " $0 " ) " ) "
77
88[ -f .gitauth ] && source .gitauth
9- [ -z " $GITHUB_TOKEN " ] && echo " missing GITHUB_TOKEN" && exit 1
9+ [ -z " ${ GITHUB_TOKEN-} " ] && echo " missing GITHUB_TOKEN" && exit 1
1010
1111for cmd in git curl jq; do
1212 [ -z " $( command -v " $cmd " ) " ] && echo " missing $cmd " && exit 1
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ function checkOutBranch() {
1818 mkdir " $folder "
1919 git clone -q $( pwd) " $folder "
2020 cd " $folder "
21+ git config --local push.autoSetupRemote true
2122 git fetch -q origin " $branch " :" $branch "
2223 git checkout -q " $branch "
2324 cd ..
@@ -87,7 +88,7 @@ done < lists.txt
8788(
8889 cd hosts
8990 git add .
90- git commit -m " Update lists"
91+ git commit -m " Update lists" || true
9192 git push -q
9293)
9394
You can’t perform that action at this time.
0 commit comments