-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.51 KB
/
main.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
name: Daily ThreatFox IOC Query
# Run the workflow once a day at midnight GMT+1 (11:00 PM UTC)
on:
schedule:
- cron: "0 13 * * *" # Run every day at GMT+1 (11:00 PM UTC)
workflow_dispatch: # Allow manual trigger of the workflow
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2 # Checkout the code from the repository
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # Install dependencies listed in the requirements.txt
- name: Run the ThreatFox IOC Query script
run: |
python3 ThreatFoxQuery.py ${{ secrets.THREATFOX_API_KEY }} 7 # Replace API_KEY with the secret in your GitHub repo
- name: Commit and push new IOC data
run: |
git config --global user.email "[email protected]" # Replace with your GitHub email
git config --global user.name "Spacechrist" # Replace with your GitHub username
git add . # Add changes to staging
git commit -m "Update ThreatFox IOCs" || echo "No changes to commit" # Commit changes, if any
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git # Use the GitHub token for authentication
git push origin main # Push changes to the main branch