-
Notifications
You must be signed in to change notification settings - Fork 50
38 lines (30 loc) · 1.03 KB
/
main.yml
File metadata and controls
38 lines (30 loc) · 1.03 KB
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
name: Auto IP Collector
on:
workflow_dispatch:
schedule:
- cron: '0 */4 * * *' # every 4 hours
jobs:
collect:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v3
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: 📦 Install dependencies
run: |
pip install requests beautifulsoup4
sT=$(TZ=UTC-8 date +'%S')
echo "update_version=$(TZ=UTC-8 date +'%Y-%m-%d %H:%M'):${sT}" >> ${GITHUB_ENV}
- name: 🧠 Run IP collector script
run: |
python collects.py
- name: 📤 Commit and push IP results
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add ipv4.txt ipv6.txt
git diff --cached --quiet || git commit -m "Updated at ${update_version}"
git push