ROS CNIP list #1215
This file contains hidden or 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: ROS CNIP list | |
| on: | |
| schedule: | |
| - cron: "00 0 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set git identity | |
| run : | | |
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --global user.name "github-actions[bot]" | |
| sudo timedatectl set-timezone "Asia/Shanghai" | |
| - name: Combine | |
| run: | | |
| clang="$(curl -kLfsm 5 https://ispip.clang.cn/all_cn_cidr.txt)" | |
| echo -e "${clang}" | sed -e 's/^/add address=/g' -e 's/$/ list=CNIP/g' | sed -e $'1i\\\n/ip firewall address-list' -e $'1i\\\nremove [find list=CNIP]' > cnip.rsc | |
| - name: Apply | |
| run: | | |
| Emoji=("π" "π€" "β¨" "π" "π" "π" "π¨" "π" "π" "π" "π" "π" "π΄" "π" "πΈ" "π½" "β " "π" "π₯" "β" "πΆ" "π " "π¦" "π€") | |
| git add . | |
| git commit -m "${Emoji[$[$RANDOM % ${#Emoji[@]}]]} Sync $(date +%Y-%m-%d" "%H:%M:%S)" | |
| git push -f |