Webhook Auto-Scan
Overview:
Deptic can automatically scan a repository whenever code is pushed to GitHub. This is implemented using GitHub webhooks — GitHub sends a push event to Deptic, which triggers a full scan without any manual action.
How it works:
User enables auto-scan for a repository in Projects page (toggle switch)
Deptic registers a webhook on GitHub: POST /repos/{owner}/{repo}/hooks
On every push to the watched branch, GitHub sends a push event to https://api.deptic.in/api/webhooks/github
Deptic verifies the HMAC-SHA256 signature using the per-webhook secret
Smart trigger: scan only fires if manifest files changed (package.json, pom.xml, go.mod etc.) OR commit message contains [deptic-scan]
Scan runs in background, results appear in dashboard automatically
Push notification sent to all subscribed devices
Smart trigger rules:
Files that trigger a scan:
package.json
package-lock.json
requirements.txt
pyproject.toml
setup.py
Pipfile
pom.xml
go.mod
go.sum
Cargo.toml
Cargo.lock
Gemfile
Gemfile.lock
composer.json
composer.lock
*.csproj
packages.configRate limits:
| Limit | Value |
|---|---|
| Max webhook-triggered scans per user per day | 10 |
| Minimum time between scans for same repo | 5 minutes |
| Duplicate commit SHA | Skipped (no re-scan) |
Webhook signature verification:
func verifyGitHubSignature(payload []byte, signature, secret string) bool {
mac := hmac.New(sha256.New, []byte(secret))
mac.Write(payload)
expected := "sha256=" + hex.EncodeToString(mac.Sum(nil))
return hmac.Equal([]byte(expected), []byte(signature))
}
