Billy Bullshit can be integrated into your CI/CD pipeline to automatically review code changes. This guide covers integration with popular CI/CD platforms.
- GitHub Actions
- GitLab CI
- Jenkins
- Pre-commit Hook
- General Integration Guide
- Best Practices
- Troubleshooting
Billy integrates seamlessly with GitHub Actions to provide automated code reviews on pull requests.
-
Copy the workflow file to your repository:
mkdir -p .github/workflows cp .github/workflows/billy-review.yml your-repo/.github/workflows/
-
Configure secrets (optional):
BILLY_API_URL- Custom Billy API endpoint (defaults to https://billy.chitty.cc)
-
Create a pull request and watch Billy work!
- ✅ Automatically triggered on PR creation and updates
- ✅ Reviews all changed code files (JS, TS, Python, Java, Go, etc.)
- ✅ Posts review comments directly on PRs
- ✅ Language detection from file extensions
- ✅ Respects
.gitignorepatterns
When Billy reviews your PR, you'll see a comment like:
## 💩 Billy's Code Review
> Calling BS on your BS code since 2024
### 📄 `src/auth.js`
BS SCORE: 8/10
🚩 CRITICAL ISSUES: Your password validation is a joke...
💩 BS DETECTOR: This function is 200 lines long...
🛠️ THE FIX: Split it into smaller functions... ```
Billy says: 💩 BS detected and called out. You're welcome.
### Customization
Edit `.github/workflows/billy-review.yml` to:
- **Change file types**: Modify the `paths` filter
```yaml
paths:
- '**.js'
- '**.py'
# Add more patterns
-
Use custom Billy instance: Set
BILLY_API_URLsecretgh secret set BILLY_API_URL --body "https://your-billy.example.com"
-
Run on specific branches: Modify the trigger
on: pull_request: branches: - main - develop
- Workflow:
.github/workflows/billy-review.yml - Documentation: This file
Integrate Billy into GitLab merge request pipelines.
-
Copy the example configuration:
cp examples/gitlab-ci.yml .gitlab-ci.yml # Or append to existing .gitlab-ci.yml -
Configure CI/CD variables (optional):
BILLY_API_URL- Custom Billy API endpointGITLAB_TOKEN- GitLab token for posting MR comments (requiresapiscope)
-
Create a merge request!
- ✅ Runs on merge requests only
- ✅ Reviews changed files (MR diff)
- ✅ Saves review as pipeline artifact
- ✅ Optional: Posts comments to MR (requires token)
- ✅ Manual full codebase review job
billy-code-review (Automatic)
- Triggered on every MR
- Reviews only changed files
- Fast and focused
billy-full-review (Manual)
- Manual trigger or scheduled
- Reviews entire codebase
- Good for periodic audits
To enable automatic MR comments:
-
Create a project access token with
apiscope:- Settings → Access Tokens → Add new token
- Scopes:
api
-
Add to CI/CD variables:
Settings → CI/CD → Variables → Add Variable Key: GITLAB_TOKEN Value: glpat-xxxxxxxxxxxx Protected: ✓ Masked: ✓
🔍 Running Billy Code Review...
Reviewing: src/utils.js
---
BS SCORE: 6/10
💩 BS DETECTOR: This utility is over-engineered...
---
✅ Billy review complete - check artifacts for full report
- Example:
examples/gitlab-ci.yml - Documentation: This file
Integrate Billy into Jenkins pipelines using a Groovy script.
-
Copy the Jenkinsfile to your repository:
cp examples/jenkins/Jenkinsfile Jenkinsfile # Or integrate into existing Jenkinsfile -
Configure Jenkins:
- Set environment variable
BILLY_API_URL(optional) - Ensure
jqis installed on Jenkins nodes
- Set environment variable
-
Create a pull request!
- ✅ Runs on pull requests (changeRequest)
- ✅ Reviews changed files only
- ✅ Archives review as build artifact
- ✅ Can post to PR comments (with plugin)
- ✅ Parallel execution support
Set in Jenkins configuration:
BILLY_API_URL- Billy API endpoint (default: https://billy.chitty.cc)
The example pipeline includes:
- Checkout - Clone repository
- Billy Code Review - Review PR changes
- Build - Your build stage
- Test - Your test stage
Billy's review is saved as billy-review.txt and archived with each build. Access via:
Build #123 → Build Artifacts → billy-review.txt
To post reviews as PR comments, use:
- GitHub: GitHub Branch Source Plugin
- GitLab: GitLab Plugin
Uncomment this line in the Jenkinsfile:
// publishReviewComment(reviewReport)And implement the publishReviewComment function for your platform.
- Jenkinsfile:
examples/jenkins/Jenkinsfile - Documentation: This file
Run Billy locally before every commit with a git pre-commit hook.
# Copy hook to your repository
cp examples/pre-commit/billy-pre-commit.sh .git/hooks/pre-commit
# Make it executable
chmod +x .git/hooks/pre-commitSet environment variables:
# In ~/.bashrc, ~/.zshrc, or ~/.profile
# Billy API URL
export BILLY_API_URL="https://billy.chitty.cc"
# Enable/disable hook
export BILLY_ENABLED="true"
# Block commits with issues (strict mode)
export BILLY_FAIL_ON_ISSUES="false" # Set to 'true' for strict mode- ✅ Reviews staged files before commit
- ✅ Runs locally (fast feedback)
- ✅ Optional strict mode (blocks commits with issues)
- ✅ Easy bypass with
--no-verify - ✅ Works with any git repository
Once installed, Billy runs automatically:
git add src/my-file.js
git commit -m "Add feature"
# Billy reviews staged changes...
# 🔍 Running Billy Code Review on staged changes...
# 📄 Reviewing: src/my-file.js
# ✅ Billy review complete!When needed:
git commit --no-verify -m "Emergency fix"Block commits with issues:
export BILLY_FAIL_ON_ISSUES="true"
git commit -m "Must be perfect"
# If Billy finds issues:
# ❌ Commit blocked. Fix the issues and try again.
# To bypass: git commit --no-verifycurl- For API requests (required)jq- For JSON parsing (optional but recommended)git- Obviously
Install jq:
# macOS
brew install jq
# Ubuntu/Debian
sudo apt-get install jq
# Fedora/RHEL
sudo dnf install jq
# Windows (Git Bash)
# Download from https://stedolan.github.io/jq/Commit the hook script to your repository and document it:
## Setup
Install the pre-commit hook:
\`\`\`bash
cp examples/pre-commit/billy-pre-commit.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
\`\`\`- Hook Script:
examples/pre-commit/billy-pre-commit.sh - Installation Guide:
examples/pre-commit/README.md - Documentation: This file
Integrate Billy into any CI/CD platform or custom script.
POST https://billy.chitty.cc/review
Content-Type: application/json
{
"code": "function add(a, b) { return a + b; }",
"language": "javascript",
"context": "File: src/utils.js (optional)"
}{
"review": "BS SCORE: 3/10\n\n💩 BS DETECTOR:\nFunction is fine but lacks type safety...\n\n🛠️ THE FIX:\nUse TypeScript or JSDoc...",
"language": "javascript",
"billy_says": "💩 BS detected and called out. You're welcome."
}curl -X POST https://billy.chitty.cc/review \
-H "Content-Type: application/json" \
-d '{
"code": "if (x == true) return true; else return false;",
"language": "javascript",
"context": "Authentication module"
}'import requests
response = requests.post(
'https://billy.chitty.cc/review',
json={
'code': 'def add(a, b):\n return a + b',
'language': 'python',
'context': 'Math utilities'
}
)
review = response.json()
print(review['review'])const response = await fetch('https://billy.chitty.cc/review', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
code: 'function add(a, b) { return a + b; }',
language: 'javascript',
context: 'Utils module'
})
});
const { review } = await response.json();
console.log(review);Billy supports these languages (detected from file extensions):
| Language | Extensions | language value |
|---|---|---|
| JavaScript | .js, .jsx | javascript |
| TypeScript | .ts, .tsx | typescript |
| Python | .py | python |
| Java | .java | java |
| Go | .go | go |
| Rust | .rs | rust |
| Ruby | .rb | ruby |
| PHP | .php | php |
| C/C++ | .c, .cpp, .cc, .cxx | c, cpp |
| C# | .cs | csharp |
Don't review the entire codebase on every commit:
# Good: Review only changed files in PR
git diff --name-only origin/main...HEAD
# Bad: Review everything
find . -name "*.js"Save Billy's review:
- GitHub Actions: Post as PR comment
- GitLab CI: Save as artifact + optional MR comment
- Jenkins: Archive as build artifact
Let the team decide:
# Allow commits, but show review
continue-on-error: trueOr only block on critical issues:
if grep -q "🚩 CRITICAL" review.txt; then
exit 1
fiBilly runs on Cloudflare Workers with generous rate limits, but:
- Batch reviews: Combine multiple files if possible
- Cache results: Don't re-review unchanged files
- Use sparingly: Only on PRs, not every push
If using a custom Billy instance:
- Use HTTPS: Always
- Authenticate: Add bearer token support if needed
- Secrets: Store API URL in CI/CD secrets, not code
Billy has limits:
- Max code size: ~10KB per request (Cloudflare Worker limits)
- Split large files: Review in chunks if needed
- Exclude generated code: Don't review minified/bundled code
Billy is opinionated. If you disagree:
- Override: Use
--no-verifyor bypass checks - Configure: Adjust
BILLY_FAIL_ON_ISSUESsettings - Feedback: Billy learns from context
Symptom: API requests fail or timeout
Solutions:
-
Check Billy service status:
curl https://billy.chitty.cc/health
-
Verify your
BILLY_API_URL:echo $BILLY_API_URL
-
Check network/firewall:
curl -v https://billy.chitty.cc/health
Symptom: Billy returns empty or no review
Causes:
- Code is perfect (rare) - Billy found nothing wrong
- API error - Check response status
- Empty file - File has no content
- Unsupported language - File extension not recognized
Debug:
# Check full API response
curl -v https://billy.chitty.cc/review \
-H "Content-Type: application/json" \
-d '{"code":"your code","language":"javascript"}'Symptom: Hook doesn't execute on commit
Solutions:
-
Ensure it's executable:
chmod +x .git/hooks/pre-commit
-
Check if it exists:
ls -la .git/hooks/pre-commit
-
Test manually:
.git/hooks/pre-commit
Symptom: Workflow doesn't run on PRs
Solutions:
-
Check workflow file location:
.github/workflows/billy-review.yml -
Verify triggers:
on: pull_request: types: [opened, synchronize, reopened]
-
Check file patterns:
paths: - '**.js' # Must match changed files
-
View workflow runs:
- GitHub → Actions → Billy Code Review
Symptom: "Permission denied" or "403 Forbidden"
Solutions:
-
GitHub Actions: Ensure permissions are set:
permissions: contents: read pull-requests: write
-
GitLab CI: Set
GITLAB_TOKENwithapiscope -
Jenkins: Configure credentials for your Git platform
Symptom: "429 Too Many Requests"
Solutions:
-
Reduce frequency:
- Don't review on every push
- Only review changed files
-
Add delays between requests:
sleep 1 # Between file reviews -
Use caching:
- Cache reviews by file hash
- Skip unchanged files
Symptom: "jq: command not found"
Impact: JSON parsing fails (minor)
Solutions:
-
Install jq:
# macOS brew install jq # Ubuntu/Debian sudo apt-get install jq
-
Or continue without jq (basic parsing still works)
#!/bin/bash
for file in $(find . -name "*.py" ! -path "*/venv/*"); do
echo "Reviewing: $file"
curl -s -X POST https://billy.chitty.cc/review \
-H "Content-Type: application/json" \
-d @- <<EOF | jq -r '.review'
{
"code": $(jq -Rs . < "$file"),
"language": "python",
"context": "File: $file"
}
EOF
echo "---"
done#!/bin/bash
# Get diff of staged changes
git diff --cached > /tmp/diff.patch
# Review the diff itself
curl -s -X POST https://billy.chitty.cc/review \
-H "Content-Type: application/json" \
-d @- <<EOF | jq -r '.review'
{
"code": $(cat /tmp/diff.patch | jq -Rs .),
"language": "diff",
"context": "Git diff of staged changes"
}
EOF#!/bin/bash
# macOS: Review code from clipboard
pbpaste | jq -Rs '{code: ., language: "javascript", context: "Clipboard"}' | \
curl -s -X POST https://billy.chitty.cc/review \
-H "Content-Type: application/json" \
-d @- | \
jq -r '.review'- API Docs: README.md
- Examples: EXAMPLES.md
- Issues: GitHub Issues
To deploy your own Billy instance:
- Clone the repository
- Configure Cloudflare Workers
- Update
BILLY_API_URLin your CI/CD
See DEPLOYMENT.md for details.
Billy says: 💩 Stop pushing BS code. Integrate me into your pipeline.
Powered by Billy Bullshit - Calling BS on your BS code since 2024