Update IPTV Mainland Domain Rules #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update IPTV Mainland Domain Rules | |
on: | |
schedule: | |
- cron: "0 */8 * * *" # 每隔8小时触发一次 | |
workflow_dispatch: # 手动触发 | |
jobs: | |
update-rules: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Fetch IPTVMainland Rules | |
run: | | |
curl -sSL https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Clash/IPTVMainland/IPTVMainland.list -o IPTVMainland.list | |
- name: Process Rules | |
run: | | |
mkdir -p rule # 确保 rule 文件夹存在 | |
echo "# 中国大陆地区 IPTV 域名列表" > rule/IPTVMainland_Domain.list | |
echo "# 从 blackmatrix7/ios_rule_script 项目拉取,并去除所有 IP 类规则和 cn 域名,仅保留非 cn 域名规则" >> rule/IPTVMainland_Domain.list | |
echo "# 每8小时更新一次" >> rule/IPTVMainland_Domain.list | |
echo "# 必须搭配 OpenClash 的“绕过大陆”功能使用" >> rule/IPTVMainland_Domain.list | |
# 去除包含 "IP-CIDR" 的行 | |
grep -v "IP-CIDR" IPTVMainland.list | \ | |
# 去除以 ".cn" 结尾的行 | |
grep -v "\.cn$" >> rule/IPTVMainland_Domain.list | |
- name: Commit and Push Changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add rule/IPTVMainland_Domain.list | |
git commit -m "Update IPTVMainland_Domain.list" | |
git push |