This is the official GitHub Action for automatically scanning your repository for Bucketeer feature flag references and sending them to your Bucketeer dashboard.
Add the following workflow file to your repository at .github/workflows/bucketeer-code-refs.yml:
name: Bucketeer Code References
on:
push:
branches:
- main
- develop
jobs:
find-code-references:
runs-on: ubuntu-latest
name: Find Bucketeer Code References
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Find Code References
uses: bucketeer-io/bucketeer-code-refs-action@v2
with:
apiKey: ${{ secrets.BUCKETEER_API_KEY }}Add your Bucketeer API Key to your repository secrets:
- Go to your repository's Settings → Secrets and variables → Actions
- Add a new secret named
BUCKETEER_API_KEYwith your API Key value
You can create an API Key in your Bucketeer dashboard by clicking the ⚙️ Settings icon → API Keys → New API Key.
| Input | Description | Required | Default |
|---|---|---|---|
apiKey |
Bucketeer API Key with write permissions | ✅ Yes | - |
apiEndpoint |
Bucketeer API endpoint URI | ✅ Yes | - |
contextLines |
Number of context lines (0-5, or -1 for no source code) | ❌ No | 2 |
debug |
Enable verbose debug logging | ❌ No | false |
allowTags |
Allow scanning of tags (lists tags as branches) | ❌ No | false |
ignoreServiceErrors |
Exit with code 0 when Bucketeer API is unreachable | ❌ No | false |
defaultBranch |
Default branch name | ❌ No | main |
dir |
Subdirectory to scan (for monorepos) | ❌ No | `` |
dryRun |
Run without sending data to Bucketeer | ❌ No | false |
Note: The action scans the branch that triggered the workflow. Configure triggers in the on: section to control which branches are scanned.
The action scans your repository for feature flag references by analyzing code patterns such as variation('my-flag'), getBooleanValue('my-flag'), and similar SDK method calls.
Important: This action scans only the branch that triggers the workflow.
on:
push:
branches: [main, develop] # Only these brancheson:
push:
branches: ['**'] # All brancheson:
pull_request: # Scan PR head branchesTip: Use branches: ['**'] for comprehensive coverage, or specify only production branches to reduce noise.
Use the dir input to specify which subdirectory to scan. Run the action multiple times with different dir values to scan multiple subdirectories.
Set ignoreServiceErrors: true to prevent CI failures when the Bucketeer API is temporarily unreachable. The action will log the error but exit with code 0.
We would ❤️ for you to contribute to Bucketeer and help improve it! Anyone can use and enjoy it!
Please follow our contribution guide at the Bucketeer documentation website.
Apache License 2.0, see LICENSE.
- bucketeer-io/bucketeer - Main Bucketeer platform
- bucketeer-io/code-refs - CLI tool used by this action