Merge Proxy Lists #242
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: Merge Proxy Lists | |
on: | |
schedule: | |
- cron: 0 8 * * * | |
workflow_dispatch: | |
jobs: | |
merge_lists: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Merge proxy lists | |
run: | | |
curl -sSL -o gfw.txt https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/gfw.txt | |
curl -sSL -o proxy-list.txt https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/proxy-list.txt | |
curl -sSL -o greatfire.txt https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/greatfire.txt | |
curl -sSL -o custom_list.txt https://raw.githubusercontent.com/Journalist-HK/Rules/master/custom_list.txt | |
cat gfw.txt proxy-list.txt greatfire.txt custom_list.txt | sort -u | sed '/^\s*$/d' | sed '/^#/d' > temp.txt | |
grep '^full:' temp.txt > temp1.txt | |
grep -vE '^(full:|regexp:)' temp.txt >> temp2.txt | |
grep '^regexp:' temp.txt > temp3.txt | |
cat temp1.txt temp2.txt temp3.txt >> temp4.txt | |
mv temp4.txt proxy_list.txt | |
rm temp*.txt | |
rm gfw.txt | |
rm proxy-list.txt | |
rm greatfire.txt | |
rm custom_list.txt | |
- name: cloudflare lists | |
run: | | |
curl -sSL -o cloudflare-ipv4.txt https://www.cloudflare.com/ips-v4 | |
curl -sSL -o cloudflare-ipv6.txt https://www.cloudflare.com/ips-v6 | |
- name: telegram lists | |
run: | | |
curl -sSL -o telegram-cidr.txt https://core.telegram.org/resources/cidr.txt | |
- name: gfwip lists | |
run: | | |
curl -sSL -o gfw_ipcidr.txt https://raw.githubusercontent.com/pmkol/easymosdns/refs/heads/rules/gfw_ip_list.txt | |
curl -sSL -o gfw_ip.txt https://raw.githubusercontent.com/jevonfy/GFWIPv4/refs/heads/main/gfw_ip_list.txt | |
curl -sSL -o facebook.txt https://raw.githubusercontent.com/Loyalsoldier/geoip/release/text/facebook.txt | |
curl -sSL -o twitter.txt https://raw.githubusercontent.com/Loyalsoldier/geoip/release/text/twitter.txt | |
cat gfw_ipcidr.txt gfw_ip.txt facebook.txt twitter.txt | sort -u > gfw_ip_list0.txt | |
rm gfw_ipcidr.txt | |
rm gfw_ip.txt | |
rm facebook.txt | |
rm twitter.txt | |
- name: Download Setup | |
run: | | |
if [ -f cidr-merger-linux-amd64 ]; then | |
echo "File exists" | |
else | |
wget https://github.com/zhanhb/cidr-merger/releases/download/v1.1.3/cidr-merger-linux-amd64 | |
fi | |
- name: merger file | |
run: | | |
chmod +x cidr-merger-linux-amd64 | |
./cidr-merger-linux-amd64 gfw_ip_list0.txt > gfw_ip_list.txt | |
rm gfw_ip_list0.txt | |
- name: Commit and push changes | |
run: | | |
if [ -z "$(git status --porcelain)" ]; then | |
echo "暂无更新,结束运行" | |
exit 0 | |
else | |
echo "status=success" >> $GITHUB_OUTPUT | |
git add . | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git commit -m "Updated at $(TZ=UTC-8 date +'%Y-%m-%d %H:%M:%S')" -a | |
git push -f -u origin main | |
fi | |