Skip to content

Add script to export Dependabot alerts to CSV - #64

Open
nicooxxx wants to merge 4 commits into
mainfrom
feature/dependabot-export
Open

Add script to export Dependabot alerts to CSV#64
nicooxxx wants to merge 4 commits into
mainfrom
feature/dependabot-export

Conversation

@nicooxxx

Copy link
Copy Markdown
Collaborator

Goal

Provide a utility script that exports all Dependabot alerts of the current GitHub repository into a timestamped CSV file for further analysis.

Changes

  • Add automatic repository detection using gh repo view
  • Fetch all Dependabot alerts via the GitHub CLI (gh api --paginate)
  • Flatten the nested API response into CSV rows
  • Export results as a timestamped CSV under:
    data/dependabot_alerts/
  • Include relevant alert metadata:
  • severity
  • package
  • ecosystem
  • manifest
  • scope
  • GHSA/CVE IDs
  • vulnerable version range
  • patched version
  • creation date
  • GitHub URL

Acceptance Criteria

  • Repository owner and name are detected automatically
  • All Dependabot alerts are retrieved (including paginated results)
  • A timestamped CSV file is generated
  • Missing optional API fields are handled without errors
  • The CSV contains one row per Dependabot alert
  • The script runs successfully using the GitHub CLI

Testing

  • Executed the script on a repository with Dependabot alerts
  • Verified the generated CSV structure
  • Confirmed that pagination returns all alerts
  • Verified handling of optional fields (e.g. missing patched version)

Notes

  • Requires an authenticated GitHub CLI (gh auth login)
  • The authenticated user must have permission to access the repository's Dependabot alerts
  • Run with python scripts/export_dependabot_alerts.py

Comment thread scripts/export_dependabot_alerts.py Fixed
@suung

suung commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

@nicooxxx Thanks. Could you update (rebase) this on main, so the quality gate is not appearing anymore?

@nicooxxx
nicooxxx force-pushed the feature/dependabot-export branch from 3b6a3c6 to 3ca08f3 Compare July 21, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants