How GitHub Integration Works
Configure ABV webhooks
- Navigate to Prompts > Webhooks in ABV
- Create a webhook with your target endpoint
- Choose events to trigger (created, updated, deleted)
- Optionally filter by prompt labels or tags
Set up GitHub Actions or webhook server
- No infrastructure required
- Uses GitHubβs
repository_dispatchevents - Perfect for triggering CI/CD workflows
- Limited to GitHub-hosted workflows
- Requires hosting a webhook receiver
- Syncs prompts to git repository as commits
- Provides full git history for prompts
- Can trigger additional automation beyond GitHub
Automate testing and deployment
- Run automated tests on prompt changes
- Validate prompt syntax and structure
- Deploy prompts to staging/production environments
- Notify teams via Slack or email
- Create pull requests for review
github.event.client_payload.* to make deployment decisions.Track versions in git history
Integration Patterns
GitHub Actions with repository_dispatch (No Infrastructure)
GitHub Actions with repository_dispatch (No Infrastructure)
- ABV webhook sends POST to
https://api.github.com/repos/{owner}/{repo}/dispatches - GitHub dispatches a
repository_dispatchevent to your repo - GitHub Actions workflow triggers on this event type
- Workflow runs tests, deployments, or any automation
- Zero infrastructure required
- GitHub-managed reliability
- Native integration with Actions ecosystem
- Secrets managed in GitHub
- Doesnβt create git commits (no history tracking)
- Limited to GitHub Actions workflows
- Canβt sync prompts to repository files
Webhook Server for Prompt Sync (Full Git History)
Webhook Server for Prompt Sync (Full Git History)
- ABV webhook sends POST to your hosted endpoint (e.g.,
https://your-server.com/webhook/prompt) - Webhook server receives payload and parses prompt data
- Server commits prompt content to repository file (e.g.,
abv_prompt.json) - Git commit triggers normal CI/CD workflows (if configured)
- Full git history for prompts (diff, blame, revert)
- Prompts version-controlled alongside code
- Can trigger multiple automation systems
- Complete audit trail in repository
- Requires hosting webhook server (Render, Fly.io, Heroku, etc.)
- Additional infrastructure to maintain
- Need GitHub PAT for API access
Combined Approach (Actions + Sync)
Combined Approach (Actions + Sync)
- Set up webhook server to sync prompts to git (creates history)
- Git commits trigger GitHub Actions workflows (via standard
on: push) - Workflows run tests and deployments based on git changes
- All prompt changes visible in repository history
- Git history for prompts
- Automated CI/CD via GitHub Actions
- Pull request reviews for prompt changes
- Comprehensive automation and audit trail
- Deploy webhook server for git sync
- Configure standard GitHub Actions on
pushevents - Prompts flow: ABV β Webhook Server β Git Commit β GitHub Actions β Deployment
Security Best Practices
Security Best Practices
- Use fine-grained PATs restricted to specific repositories
- For repository_dispatch:
actions: read and write - For git commits:
contents: read and write, metadata: read-only - Never use classic tokens with full
reposcope unless absolutely necessary
- Store GitHub tokens in environment variables or secrets managers
- Never commit tokens to repositories
- Rotate tokens periodically
- ABV retries failed webhooks with exponential backoff
- Design webhook handlers to be idempotent (duplicate events safe)
- Return 2xx status codes on success to prevent retries
Implementation: GitHub Actions (No Infrastructure)
Step 1: Create GitHub Actions Workflow
Step 1: Create GitHub Actions Workflow
.github/workflows/abv-ci.yml in your repository:- Use
github.event.client_payload.*to access prompt data github.event.client_payload.action:created,updated, ordeletedgithub.event.client_payload.prompt.*: Full prompt object (name, version, labels, content, etc.)
- Use
if: contains(github.event.client_payload.prompt.labels, 'production')to run steps only for production prompts - Use
if: github.event.client_payload.action == 'created'to run on prompt creation only
Step 2: Create GitHub Token for Actions
Step 2: Create GitHub Token for Actions
- Go to GitHub Settings β Developer settings β Personal access tokens
- Click Generate new token
- Choose token type and set permissions:
| Token Type | Required Permissions |
|---|---|
| Personal Access Token (classic) | repo scope (for private repos) or public_repo scope (for public repos) |
| Fine-grained PAT | Repository permissions: Actions: read and write, Metadata: read-only |
| GitHub App | Repository permissions: Actions: read and write |
- Generate token and copy it immediately (wonβt be shown again)
- Store token securely for ABV webhook configuration
Step 3: Configure ABV Webhook for GitHub Actions
Step 3: Configure ABV Webhook for GitHub Actions
- In ABV dashboard, navigate to Prompts β Webhooks
- Click Create Webhook
- Set the following fields:
{owner} with your GitHub username or organization, and {repo} with repository name.Example:{your_github_token} with the PAT created in Step 2.Request body template (ABV automatically sends this):- (Optional) Filter events by labels or tags to reduce noise
- Click Save
Step 4: Test GitHub Actions Integration
Step 4: Test GitHub Actions Integration
-
Update a prompt in ABV:
- Open an existing prompt or create a new one
- Make a change (edit content, update variables, etc.)
- Assign the
productionlabel - Save the prompt (creates a new version)
-
Check GitHub Actions tab:
- Navigate to your repository on GitHub
- Click Actions tab
- Look for a new workflow run named βABV Prompt CIβ
- Workflow should show βrepository_dispatchβ as trigger
-
Verify workflow execution:
- Click into the workflow run
- Verify
testjob completes successfully - Verify
deployjob runs (if prompt hadproductionlabel) - Check job logs to see prompt data (name, version, labels)
-
Troubleshooting:
- If workflow doesnβt trigger: verify webhook URL and GitHub token
- If workflow fails: check logs for errors
- If deploy job skipped: verify prompt has
productionlabel
Implementation: Webhook Server (Git Sync)
Architecture Overview
Architecture Overview
Workflow:- User saves prompt in ABV
- ABV sends webhook POST to your server
- Server validates webhook signature
- Server fetches current file SHA from GitHub
- Server commits updated prompt JSON to repository
- Git commit triggers standard CI/CD workflows
- ABV Webhook: Sends prompt change events
- Webhook Server: FastAPI application (or any language/framework)
- GitHub API: Receives commits via REST API
- Repository: Stores prompts in version control
Step 1: Configure ABV Webhook for Sync
Step 1: Configure ABV Webhook for Sync
- In ABV dashboard, navigate to Prompts β Webhooks
- Click Create Webhook
- Configure the following:
created: Trigger when new prompt versions are createdupdated: Trigger when prompts are updateddeleted: Trigger when prompts are deleted
- ABV generates a signing secret automatically
- Copy this secret and save it securely (youβll need it for webhook verification)
- Click Save
Step 2: Prepare GitHub Repository and Token
Step 2: Prepare GitHub Repository and Token
.env file with configuration:| Permission Type | Required Scopes |
|---|---|
| Fine-grained PAT (recommended) | Repository permissions: β’ Contents: Read and write β’ Metadata: Read-only |
| Classic PAT | β’ public_repo (for public repositories)β’ repo (for private repositories) |
- GitHub Settings β Developer settings β Personal access tokens
- Generate new token (fine-grained recommended)
- Select repository access (specific repo or all repos)
- Set permissions as listed above
- Generate and copy token
- Add to
.envfile asGITHUB_TOKEN
Step 3: Implement FastAPI Webhook Server
Step 3: Implement FastAPI Webhook Server
main.py:- Validates webhook payload structure using Pydantic
- Checks if prompt has required label (if configured)
- Fetches existing file SHA from GitHub (required for updates)
- Commits prompt JSON to repository with descriptive message
- Returns commit info to ABV (2xx status prevents retries)
http://localhost:8000/status.Local testing: Use ngrok or similar to expose localhost for webhook testing:Step 4: Deploy Webhook Server
Step 4: Deploy Webhook Server
- Create
requirements.txt: - Create
render.yaml: - Push to GitHub and connect repository in Render dashboard
- Set environment variables in Render dashboard
- Deploy
- Install Fly CLI:
curl -L https://fly.io/install.sh | sh - Run
fly launchand follow prompts - Set secrets:
fly secrets set GITHUB_TOKEN=... GITHUB_REPO_OWNER=... GITHUB_REPO_NAME=... - Deploy:
fly deploy
- Create
Procfile: - Deploy via Heroku CLI or GitHub integration
- Set config vars in Heroku dashboard
- Note your public HTTPS URL (e.g.,
https://abv-sync.onrender.com) - Update ABV webhook endpoint to
https://your-domain.com/webhook/prompt - Test by updating a prompt in ABV
- Verify new commit appears in GitHub repository
Testing and Troubleshooting
Testing and Troubleshooting
- Navigate to your repository
- Look for new commit with message:
created: test-prompt v1 - Verify
abv_prompt.jsoncontains the prompt data
| Issue | Solution |
|---|---|
| 401 Unauthorized | Verify GitHub token has correct permissions |
| 404 Not Found | Check GITHUB_REPO_OWNER and GITHUB_REPO_NAME are correct |
| 409 Conflict | File SHA mismatch; ensure server fetches current SHA |
| No commit created | Check server logs for errors; verify token has contents: write permission |
| ABV shows failed webhooks | Ensure server returns 2xx status code; check server logs |
- Render: Dashboard β Logs tab
- Fly.io:
fly logs - Heroku:
heroku logs --tail
Advanced Patterns
Filter by Label (Production Only)
Filter by Label (Production Only)
production) to avoid cluttering git history with experiments.In webhook server .env:- Prompts with
productionlabel: synced to GitHub - Prompts without
productionlabel: skipped (webhook returns success without committing)
Multi-File Organization
Multi-File Organization
Trigger Multiple Workflows
Trigger Multiple Workflows
- Deploy production-labeled prompts to production environment
- Deploy staging-labeled prompts to staging environment
- Run experiments for prompts tagged with
experiment
Signature Verification for Security
Signature Verification for Security
- Prevents unauthorized webhook calls
- Ensures payload integrity (not modified in transit)
- Production security best practice