How alexellis/derek works
Derek is a webhook-driven GitHub App that automates repository governance and delegates issue/PR actions. GitHub sends events to the runtime entry point, which parses and routes them, verifies customer/configuration eligibility where applicable, then invokes feature handlers that update GitHub. The graph preserves the documented DCO, PR-governance, issue-template, comment-command, Hacktoberfest, and release-note capabilities. Source excerpts were partial, so some capability wiring and internal calls are not shown beyond what the README or sampled code supports.
Main entry points: main.go Webhook entry and router · permissions_handler.go Repository configuration · pullrequest_handler.go PR and DCO checks · hacktoberfest_handler.go Hacktoberfest checks
Components 17
Webhook runtime
- Webhook entry and router
main.go - App configuration
config/config.go - Webhook data types
types/types.go
Access and configuration
- Customer validation
auth/customers.go - Repository configuration
handler/permissions_handler.go - Configuration merge
types/merge.go - Installation tokens
auth/jwt_auth.go - GitHub client
factory/client_factory.go
Repository governance
- PR and DCO checks
handler/pullrequest_handler.go - Hacktoberfest checks
handler/hacktoberfest_handler.go - Issue template checks
handler/template_handler.go
Delegated commands
- Comment command handler
handler/comment_handler.go
Release notes
- Release changelog
handler/release_handler.go
Other components
- GitHub activity
- GitHub API
- GitHub-hosted config
- Customer registry
Connections 27
- GitHub activity → Webhook entry and router: sends webhook
- Webhook entry and router → App configuration: loads settings
- Webhook entry and router → Webhook data types: parses payload
- Webhook entry and router → Customer validation: checks customer
- Customer validation → Customer registry: reads registry
- Webhook entry and router → Repository configuration: loads repo settings
- Repository configuration → GitHub-hosted config: fetches config
- Repository configuration → Configuration merge: merges settings
- Repository configuration → GitHub API: downloads private config
- Webhook entry and router → PR and DCO checks: dispatches PR
- Webhook entry and router → Hacktoberfest checks: dispatches spam check
- Webhook entry and router → Issue template checks: dispatches issue check
- Webhook entry and router → Comment command handler: dispatches comment
- Webhook entry and router → Release changelog: dispatches release
- PR and DCO checks → Installation tokens: gets token
- Hacktoberfest checks → Installation tokens: gets token
- Comment command handler → Installation tokens: gets token
- Installation tokens → GitHub API: requests token
- PR and DCO checks → GitHub client: creates client
- Hacktoberfest checks → GitHub client: creates client
- Comment command handler → GitHub client: creates client
- Issue template checks → GitHub API: labels and comments
- PR and DCO checks → GitHub API: checks and updates PR
- Hacktoberfest checks → GitHub API: checks and updates PR
- Comment command handler → GitHub API: applies commands
- Release changelog → GitHub API: reads and updates release
- Release changelog → GitHub client: creates client