GitHub Actions Integration
Run BugBrain tests automatically on every push and pull request.
Setup
1. Generate CI/CD Token
- Go to Settings → CI/CD
- Click “Generate Token”
- Copy Webhook URL and Secret
2. Add GitHub Secrets
In your GitHub repo:
- Go to Settings → Secrets and variables → Actions
- Create 2 new secrets:
BUGBRAIN_WEBHOOK_URL=https://your-domain.com/api/webhooks/... BUGBRAIN_WEBHOOK_SECRET=your_secret_here - (Optional) Create
BUGBRAIN_TEST_PLAN_IDif you want to run a specific test plan
3. Create Workflow File
Create .github/workflows/bugbrain-tests.yml:
name: BugBrain Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Trigger BugBrain Tests
run: |
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Gitlab-Token: ${{ secrets.BUGBRAIN_WEBHOOK_SECRET }}" \
-d '{
"ref": "${{ github.ref }}",
"commit": "${{ github.sha }}",
"repository": "${{ github.repository }}",
"testPlanId": "${{ vars.BUGBRAIN_TEST_PLAN_ID }}"
}' \
${{ secrets.BUGBRAIN_WEBHOOK_URL }}4. Test It
- Push a commit to
main - Watch tests trigger in BugBrain
- Results appear in GitHub Actions
Adding Status Badge
Add to your README.md:
[](https://bugbrain.tech)Configuration
Run on Specific Branches
on:
push:
branches: [main, staging] # Only these branchesRun on Pull Requests
on:
pull_request:
branches: [main] # Only PR to mainRun on Schedule
on:
schedule:
- cron: '0 9 * * *' # Daily at 9 AM UTC