-
Notifications
You must be signed in to change notification settings - Fork 31
71 lines (62 loc) · 2.6 KB
/
clash-rule-to-shadowrocket.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
60
61
62
63
64
65
66
67
68
69
70
71
#=================================================
# Description: Generate Rule Provider for Clash
# Script by helmiau.com
# https://github.com/blackmatrix7/ios_rule_script/tree/master/rule/Clash/'
# Run setiap 2 jam sekali
# curl -sL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/README.md | grep "blackmatrix7/ios_rule_script/tree/master/rule/Clash" | sed -e 's/ //g' -e 's/|/\n/g' -e 's#https://github.com/blackmatrix7/ios_rule_script/tree/master/rule/Clash/#rule_name: #iIg' -e 's#(#bukaan#g' -e 's#)##g' | sed '/^[[:space:]]*$/d' | sed 's/^.*\(rule_name.*\).*$/\1/' | sed 's#rule_name# - rule_name#g' > include-rule.yaml
# Run setiap 2 jam sekali
#=================================================
name: Clash Rule to Shadowrocket Converter
on:
# push:
# branches:
# - main
workflow_dispatch:
# schedule:
# - cron: 0 15 * * *
# watch:
# types: started
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Set timezone to WIB Jakarta
uses: szenius/set-timezone@master
with:
timezoneLinux: "Asia/Jakarta"
timezoneMacos: "Asia/Jakarta"
timezoneWindows: "Indonesia Standard Time"
- name: Generate current time
id: waktu
run: |
echo "waktu=$(date +'%d-%m-%Y %H:%M:%S')" >> $GITHUB_OUTPUT
- name: Converting files
id: generate
run: |
find . -name "*.yaml" -exec sh -c 'mv "$1" "${1%.yaml}.list"' _ {} \;
sed -i 's/payload://g' $(grep -rli "payload" rule_provider)
sed -i 's/ - //g' $(grep -rli " -" rule_provider)
sed -i 's/ //g' $(grep -rli " " rule_provider)
mv -v rule_provider/* shadowrocket
#echo "========= LS RULE PROVIDER ========="
#ls rule_provider
#echo "========= LS SHADOWROCKET ========="
#ls shadowrocket
#echo "=========== END LS TASKS =========="
echo "status=success" >> $GITHUB_OUTPUT
- name: Update GitHub page data
if: steps.generate.outputs.status == 'success' && !cancelled()
uses: test-room-7/action-update-file@main
with:
commit-msg: "Shadowrocket rules updated: ${{ steps.waktu.outputs.waktu }}"
file-path: "shadowrocket/*.list"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Delete Workflow Runs
uses: ophub/delete-releases-workflows@main
with:
delete_releases: false
delete_workflows: true
workflows_keep_day: 0
gh_token: ${{ secrets.GITHUB_TOKEN }}