Skip to main content

How GitHub Integration Works

Configure ABV webhooks

Set up webhooks in your ABV project to send events when prompts are created, updated, or deleted. ABV sends HTTP POST requests to your specified endpoint with full prompt data.Webhook configuration:
  • 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
ABV sends webhook payloads containing:

Set up GitHub Actions or webhook server

Choose one of two integration patterns based on your needs:Option 1: GitHub Actions (recommended for most users)
  • No infrastructure required
  • Uses GitHub’s repository_dispatch events
  • Perfect for triggering CI/CD workflows
  • Limited to GitHub-hosted workflows
Option 2: Webhook Server (for advanced use cases)
  • Requires hosting a webhook receiver
  • Syncs prompts to git repository as commits
  • Provides full git history for prompts
  • Can trigger additional automation beyond GitHub
Both options can be combined for maximum automation.

Automate testing and deployment

Once webhooks reach GitHub, configure workflows to:
  • 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
Example workflow trigger:
Access prompt data in workflows via github.event.client_payload.* to make deployment decisions.

Track versions in git history

If using the webhook server option, every prompt change creates a git commit:
This provides a complete audit trail and enables git-based workflows (diff, blame, revert).

Integration Patterns

The simplest integration pattern. Trigger GitHub Actions workflows directly from ABV webhooks without hosting any infrastructure.How it works:
  1. ABV webhook sends POST to https://api.github.com/repos/{owner}/{repo}/dispatches
  2. GitHub dispatches a repository_dispatch event to your repo
  3. GitHub Actions workflow triggers on this event type
  4. Workflow runs tests, deployments, or any automation
Benefits:
  • Zero infrastructure required
  • GitHub-managed reliability
  • Native integration with Actions ecosystem
  • Secrets managed in GitHub
Limitations:
  • Doesn’t create git commits (no history tracking)
  • Limited to GitHub Actions workflows
  • Can’t sync prompts to repository files
Best for: Teams that want automated deployments without managing infrastructure, and don’t need git history for prompts.
Host a webhook receiver that commits prompt changes to your git repository, providing full version control history.How it works:
  1. ABV webhook sends POST to your hosted endpoint (e.g., https://your-server.com/webhook/prompt)
  2. Webhook server receives payload and parses prompt data
  3. Server commits prompt content to repository file (e.g., abv_prompt.json)
  4. Git commit triggers normal CI/CD workflows (if configured)
Benefits:
  • Full git history for prompts (diff, blame, revert)
  • Prompts version-controlled alongside code
  • Can trigger multiple automation systems
  • Complete audit trail in repository
Limitations:
  • Requires hosting webhook server (Render, Fly.io, Heroku, etc.)
  • Additional infrastructure to maintain
  • Need GitHub PAT for API access
Best for: Teams that want prompts fully integrated into version control, or need comprehensive audit trails.
Use both patterns together for maximum automation and visibility.How it works:
  1. Set up webhook server to sync prompts to git (creates history)
  2. Git commits trigger GitHub Actions workflows (via standard on: push)
  3. Workflows run tests and deployments based on git changes
  4. All prompt changes visible in repository history
Benefits:
  • Git history for prompts
  • Automated CI/CD via GitHub Actions
  • Pull request reviews for prompt changes
  • Comprehensive automation and audit trail
Setup:
  • Deploy webhook server for git sync
  • Configure standard GitHub Actions on push events
  • Prompts flow: ABV β†’ Webhook Server β†’ Git Commit β†’ GitHub Actions β†’ Deployment
Best for: Enterprise teams requiring both automation and compliance/audit capabilities.
Secure your GitHub integration to prevent unauthorized access and ensure data integrity.Verify webhook signatures:
Limit GitHub PAT scope:
  • 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 repo scope unless absolutely necessary
Environment variables:
  • Store GitHub tokens in environment variables or secrets managers
  • Never commit tokens to repositories
  • Rotate tokens periodically
Handle retries safely:
  • 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)

Create .github/workflows/abv-ci.yml in your repository:
Accessing webhook data:
  • Use github.event.client_payload.* to access prompt data
  • github.event.client_payload.action: created, updated, or deleted
  • github.event.client_payload.prompt.*: Full prompt object (name, version, labels, content, etc.)
Conditional execution:
  • 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
Generate a GitHub Personal Access Token with appropriate permissions.Token creation steps:
  1. Go to GitHub Settings β†’ Developer settings β†’ Personal access tokens
  2. Click Generate new token
  3. Choose token type and set permissions:
  1. Generate token and copy it immediately (won’t be shown again)
  2. Store token securely for ABV webhook configuration
Security tip: Fine-grained PATs are recommended as they can be scoped to specific repositories and have expiration dates.
Configure ABV to send webhooks to GitHub’s repository_dispatch API.Configuration steps:
  1. In ABV dashboard, navigate to Prompts β†’ Webhooks
  2. Click Create Webhook
  3. Set the following fields:
Endpoint URL:
Replace {owner} with your GitHub username or organization, and {repo} with repository name.Example:
Headers: Add two headers:
Replace {your_github_token} with the PAT created in Step 2.Request body template (ABV automatically sends this):
  1. (Optional) Filter events by labels or tags to reduce noise
  2. Click Save
Important: ABV encrypts and securely stores your GitHub token in the Authorization header.
Verify the integration works end-to-end.Testing steps:
  1. Update a prompt in ABV:
    • Open an existing prompt or create a new one
    • Make a change (edit content, update variables, etc.)
    • Assign the production label
    • Save the prompt (creates a new version)
  2. 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
  3. Verify workflow execution:
    • Click into the workflow run
    • Verify test job completes successfully
    • Verify deploy job runs (if prompt had production label)
    • Check job logs to see prompt data (name, version, labels)
  4. 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 production label
Expected result: Prompt change in ABV automatically triggers GitHub Actions workflow, runs tests, and deploys (if conditions met).

Implementation: Webhook Server (Git Sync)

The webhook server receives prompt change events from ABV and commits them to your GitHub repository.Flow diagram:GitHub Integration FlowWorkflow:
  1. User saves prompt in ABV
  2. ABV sends webhook POST to your server
  3. Server validates webhook signature
  4. Server fetches current file SHA from GitHub
  5. Server commits updated prompt JSON to repository
  6. Git commit triggers standard CI/CD workflows
Components:
  • 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
Set up a webhook in ABV to send events to your webhook server.Configuration steps:
  1. In ABV dashboard, navigate to Prompts β†’ Webhooks
  2. Click Create Webhook
  3. Configure the following:
Endpoint URL:
(You’ll deploy the server in later steps)Events: (optional filters)
  • created: Trigger when new prompt versions are created
  • updated: Trigger when prompts are updated
  • deleted: Trigger when prompts are deleted
Default: all events selected.Signing Secret:
  • ABV generates a signing secret automatically
  • Copy this secret and save it securely (you’ll need it for webhook verification)
  1. Click Save
Sample webhook payload:
Note: Your webhook endpoint must return 2xx status codes for successful processing. ABV retries failed webhooks with exponential backoff.
Set up GitHub repository and create a PAT for API access.Create .env file with configuration:
GitHub PAT permissions: Create a token with minimal required permissions:PAT creation:
  1. GitHub Settings β†’ Developer settings β†’ Personal access tokens
  2. Generate new token (fine-grained recommended)
  3. Select repository access (specific repo or all repos)
  4. Set permissions as listed above
  5. Generate and copy token
  6. Add to .env file as GITHUB_TOKEN
Security: Fine-grained PATs expire and can be scoped to specific repositories, reducing security risk.
Create a webhook server that receives ABV events and commits to GitHub.Create main.py:
How it works:
  • 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)
Install dependencies:
Run locally:
Access health check at http://localhost:8000/status.Local testing: Use ngrok or similar to expose localhost for webhook testing:
Deploy the webhook server to a public HTTPS endpoint.Deployment options:Option 1: Render.com (recommended for beginners)
  1. Create requirements.txt:
  2. Create render.yaml:
  3. Push to GitHub and connect repository in Render dashboard
  4. Set environment variables in Render dashboard
  5. Deploy
Option 2: Fly.io
  1. Install Fly CLI: curl -L https://fly.io/install.sh | sh
  2. Run fly launch and follow prompts
  3. Set secrets: fly secrets set GITHUB_TOKEN=... GITHUB_REPO_OWNER=... GITHUB_REPO_NAME=...
  4. Deploy: fly deploy
Option 3: Heroku
  1. Create Procfile:
  2. Deploy via Heroku CLI or GitHub integration
  3. Set config vars in Heroku dashboard
After deployment:
  1. Note your public HTTPS URL (e.g., https://abv-sync.onrender.com)
  2. Update ABV webhook endpoint to https://your-domain.com/webhook/prompt
  3. Test by updating a prompt in ABV
  4. Verify new commit appears in GitHub repository
Verify the webhook server is working correctly.Test health endpoint:
Test webhook endpoint manually:
Expected response:
Check GitHub repository:
  • Navigate to your repository
  • Look for new commit with message: created: test-prompt v1
  • Verify abv_prompt.json contains the prompt data
Common issues:View server logs:
  • Render: Dashboard β†’ Logs tab
  • Fly.io: fly logs
  • Heroku: heroku logs --tail

Advanced Patterns

Sync only prompts with specific labels (e.g., production) to avoid cluttering git history with experiments.In webhook server .env:
Behavior:
  • Prompts with production label: synced to GitHub
  • Prompts without production label: skipped (webhook returns success without committing)
In GitHub Actions:
This pattern ensures only vetted, production-ready prompts trigger deployments or appear in git history.
Store different prompts in separate files for better organization.Modify webhook server to use prompt name as file path:
Result:
Each prompt gets its own file, making git diffs clearer and enabling granular access control.
Trigger different workflows based on prompt metadata (labels, tags, name patterns).GitHub Actions with conditional workflows:
Use cases:
  • Deploy production-labeled prompts to production environment
  • Deploy staging-labeled prompts to staging environment
  • Run experiments for prompts tagged with experiment
Verify webhook signatures to ensure requests come from ABV and haven’t been tampered with.Add to webhook server:
Benefits:
  • Prevents unauthorized webhook calls
  • Ensures payload integrity (not modified in transit)
  • Production security best practice

Next Steps

Webhook & Slack Integration

Send prompt change notifications to Slack channels using webhooks

Get Started with Prompt Management

Complete quickstart guide for creating and deploying prompts

Version Control

Deploy and rollback prompts safely using labels and versions

A/B Testing Prompts

Run statistical A/B tests on prompt variants in production