Skip to content

Ingest GHSA Malware #1156

Ingest GHSA Malware

Ingest GHSA Malware #1156

Workflow file for this run

name: Ingest GHSA Malware
on:
schedule:
- cron: '15 * * * *' # Every hour, at quarter past. To limit conflicts.
workflow_dispatch:
permissions: read-all
jobs:
ingest-ghsa:
name: Ingest GHSA
continue-on-error: false
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
steps:
- name: Checkout self
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ secrets.GH_TOKEN }}
- name: Checkout ossf/osv-schema
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ secrets.GH_TOKEN }}
repository: ossf/osv-schema
ref: aeaeeeeb3f6473c294fc1d18a32e9a5a794a5c47
path: osv-schema
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: 'go.mod'
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: "3.13"
cache: pipenv
cache-dependency-path: osv-schema/tools/ghsa/Pipfile.lock
- name: Install pipenv
run: |
pip install pipenv==2025.0.4
- name: Install dependencies
run: |
cd osv-schema/tools/ghsa
pipenv sync
- name: Dump GHSA Malware
run: |
cd osv-schema/tools/ghsa
mkdir OUT
TIMESINCE=`python3 -c 'import datetime; dt=datetime.datetime.now(datetime.UTC)-datetime.timedelta(hours=24); print(dt.isoformat())'`
pipenv run python dump_ghsa.py --token "${{ github.token }}" --query "classifications: [MALWARE] updatedSince: \"$TIMESINCE\"" OUT
- name: Convert GHSA to OSV
run: |
cd osv-schema/tools/ghsa
mkdir OSV
pipenv run python convert_ghsa.py -o OSV OUT/*.json
- name: Ingest OSV
run: |
go run ./cmd/ingest -config config/config.yaml -dir osv-schema/tools/ghsa/OSV -source ghsa-malware
- name: Prepare commit
run: |
git config user.name github-actions
git config user.email [email protected]
git add osv
- name: Commit report changes
run: git diff --cached --quiet || git commit -m 'Ingest OSV - GHSA Malware'
- name: Push commit
run: git push
- name: Save OSV for debugging
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ghsa-osv
path: osv-schema/tools/ghsa/OSV/*.json
retention-days: 14