Weekly Update DB #25
This file contains 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: Weekly Update DB | |
on: | |
schedule: | |
- cron: '0 0 * * 0' # Every Sunday at 00:00 | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
update_capec_db: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- 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 | |
- name: Update CAPEC DB | |
run: python update_capec_db.py | |
- name: Commit and push changes | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "[email protected]" | |
git diff --quiet && git diff --staged --quiet || git add resources/capec_db.json | |
git diff --staged --quiet || git commit -m "Update CAPEC DB" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
update_cwe_db: | |
runs-on: ubuntu-latest | |
needs: update_capec_db | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- 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 | |
- name: Pull latest changes | |
run: git pull | |
- name: Update CWE DB | |
run: python update_cwe_db.py | |
- name: Commit and push changes | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "[email protected]" | |
git diff --quiet && git diff --staged --quiet || git add resources/cwe_db.json | |
git diff --staged --quiet || git commit -m "Update CWE DB" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
update_technique_db: | |
runs-on: ubuntu-latest | |
needs: update_cwe_db | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- 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 | |
- name: Pull latest changes | |
run: git pull | |
- name: Update TECHNIQUES DB | |
run: python update_technique_db.py | |
- name: Commit and push changes | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "[email protected]" | |
git diff --quiet && git diff --staged --quiet || git add resources/techniques_db.json | |
git diff --staged --quiet || git commit -m "Update CWE DB" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |