-
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.14 KB
/
fetch-ips.yml
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
39
40
41
42
43
44
45
46
name: Fetch IPs
on:
schedule: # https://crontab.guru
- cron: '0 */2 * * *' # At minute 0 past every 2nd hour.
workflow_dispatch:
jobs:
fetch-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: main
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Fetch IPs from API and update files
run: node worker.js
env:
SEFIN_API_KEY: ${{ secrets.SEFIN_API_KEY }}
- name: Check for changes
id: check_changes
run: |
git status -s > changes.txt
echo "::set-output name=has_changes::$(cat changes.txt | wc -l)"
- name: Commit and push changes if necessary
if: steps.check_changes.outputs.has_changes != '0'
run: |
git config user.name "Sefinek Actions"
git config user.email "[email protected]"
git add .
git commit -am "Update the list of malicious IP addresses"
git push origin main