Skip to content

Update auto.yml

Update auto.yml #33

Workflow file for this run

name: IP合集
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
StatisticalIP:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/[email protected]
- name: 整理全部IP
run: |
mkdir -p Collection
find . -type f -name "*.txt" -not -name "all.txt" -not -name "multi-dial.txt" -not -name "ipv4_all.txt" -not -name "ipv6_all.txt" -not -name "IP_all.txt" -exec cat {} + | sort | uniq > Collection/ipv4_6.txt
- name: 分离IPv4
run: |
cd Collection
grep -E "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" ipv4_6.txt > ipv4.txt
- name: 分离IPv6
run: |
cd Collection
grep -vFf ipv4.txt ipv4_6.txt > ipv6.txt
- name: 优化目录
run: |
mkdir -p List
mv \
"0xde-0xad-0xbe-0xef.txt" \
"123pan.txt" \
"dt_torrent.txt" \
"go.torrent dev 20181121.txt" \
"hp_torrent.txt" \
"multi-dial.txt" \
"gitlab.i.ljyun.cn-hangzhou-monitoring.txt" \
"progress-rewind.txt" \
List/
- name: 安装python运行环境
uses: actions/[email protected]
- name: 安装依赖_ipaddress
run: |
python -m pip install --upgrade pip
pip install ipaddress
- name: 使用Python脚本处理得到CIDR
run: |
mkdir -p CIDR
python CIDR.py -i "${{ github.workspace }}/Collection/ipv4.txt" -o "${{ github.workspace }}/CIDR"
python CIDR.py -i "${{ github.workspace }}/Collection/ipv6.txt" -o "${{ github.workspace }}/CIDR"
- name: Commit changes
run: |
git fetch origin
git checkout -b auto || git checkout auto
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git add .
if git diff-index --quiet HEAD; then
echo "No changes to commit"
else
git commit -m "自动生成[skip ci]"
git push -f origin auto
fi