-
Notifications
You must be signed in to change notification settings - Fork 26
46 lines (38 loc) · 1.39 KB
/
fetch_cve_details.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 CVE Details
on:
workflow_dispatch:
schedule:
- cron: '45 20,6 * * *'
jobs:
fetch_cve_details:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Specify the version of Python you need
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Run CVE fetcher script
env:
API_KEY: ${{ secrets.VULNCHECK_API_KEY }} # Ensure your API key is stored in GitHub secrets
run: python build-cve-cache.py
- name: List contents of current directory
run: ls -la
- name: Commit and push if changes are detected
run: |
# Get the current timestamp
timestamp=$(date +'%Y-%m-%d %H:%M:%S')
# Configure git user for committing
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
# Stage the modified cve_details.json file for commit
git add cache/cve_details.json
# Commit changes with a timestamp, exit if no changes to commit
git commit -m "Update CVE details - $timestamp" -a || exit 0
# Push the changes to the remote repository
git push