TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/morwn/github-threat-detector/llms.txt
Use this file to discover all available pages before exploring further.
collect command is your data-ingestion entry point. It queries the GitHub API for events on one or more repositories (or entire organizations) and writes raw payloads into PostgreSQL. Optional flags extend collection to GitHub Actions workflow runs, releases, contributor lists, workflow YAML files, and per-push commit metadata — each of which unlocks additional detection rules in analyze.
Usage
Options
Comma-separated list of repositories to collect from, in
owner/repo format.
When omitted, the tool falls back to the GITHUB_REPOS environment variable (or DEFAULT_REPOS in config.py).
Either --repos or --orgs must be provided.Comma-separated list of GitHub organization names. Collects org-level events for every repository visible to your token.
Can be combined with
--repos to mix individual repositories and whole organizations in a single run.Also collect GitHub Actions workflow run records for each specified repository.
Populates the
workflow_runs table, which is required by the workflow-run-from-fork and rapid-releases rules.Also collect GitHub release events for each specified repository.
Required to feed the
release-actor-anomaly and rapid-releases analyzers.Seed the contributor list for each repository by calling the GitHub Contributors API.
Storing known contributors as a baseline significantly improves the accuracy of the
release-actor-anomaly rule by distinguishing established maintainers from first-time release actors.Fetch the raw YAML content of every workflow file (
.github/workflows/*.yml) for each repository and store it in the workflow_files table.
This data is consumed by static-analysis rules that search for unsafe ${{ github.event.* }} interpolations.Fetch commit metadata for every push event on the default branch and store it in the
push_commits table.
Enables tamper-detection rules (commit-date-gap, null-committer-email) that compare commit timestamps and author fields against expected values.Examples
Minimal — collect events for a single repository:--workflow-files must be passed at collection time to enable the ai-workflow-unsafe-input and issue-prompt-injection detection rules during analysis. Without it, workflow YAML content is not stored and those analyzers will produce no findings.Similarly, --commits is required to populate the commit metadata consumed by the commit-date-gap and null-committer-email tamper-detection rules.Notes
collectcallsapply_schema()automatically on startup, so it is safe to run beforeinit-dbhas been called manually.- For org-level collection (
--orgs), only top-level org events are fetched. To also collect Actions runs or releases for org repos, combine--orgswith--actionsor--releases. - GitHub’s Events API returns up to 300 events per repository. For high-traffic repositories, schedule
collectfrequently (e.g., every 5–10 minutes via cron) to avoid missing events between polling intervals.