CI/CD Integration
NeuralRepo’s REST API integrates cleanly into CI/CD pipelines. You can automatically create ideas, update statuses, and track project lifecycle events from GitHub Actions, GitLab CI, or any automation platform.
Setting Up API Key Auth for CI
Section titled “Setting Up API Key Auth for CI”-
Create a dedicated API key. Go to Settings > API Keys in the NeuralRepo web dashboard and create a new key. Name it something descriptive like
github-actionsorci-pipeline. -
Store as a secret. Add the key as a repository secret in your CI provider:
- GitHub Actions: Repository Settings > Secrets > New repository secret. Name it
NEURALREPO_API_KEY. - GitLab CI: Settings > CI/CD > Variables. Add
NEURALREPO_API_KEYas a masked variable.
- GitHub Actions: Repository Settings > Secrets > New repository secret. Name it
-
Use in your pipeline. Reference the secret in your workflow file.
GitHub Actions Examples
Section titled “GitHub Actions Examples”Create an Idea on Release
Section titled “Create an Idea on Release”Automatically capture a new idea when a GitHub Release is published:
name: NeuralRepo — Track Releaseon: release: types: [published]
jobs: track-release: runs-on: ubuntu-latest steps: - name: Create NeuralRepo idea run: | curl -s -X POST "https://neuralrepo.com/api/v1/ideas" \ -H "X-API-Key: ${{ secrets.NEURALREPO_API_KEY }}" \ -H "Content-Type: application/json" \ -d '{ "title": "Release: ${{ github.event.release.tag_name }}", "body": "${{ github.event.release.body }}", "tags": ["release", "${{ github.event.repository.name }}"], "status": "shipped", "source_url": "${{ github.event.release.html_url }}" }'Update Status on Deploy
Section titled “Update Status on Deploy”Mark an idea as shipped when a deployment succeeds:
name: Deploy & Update NeuralRepoon: push: branches: [main]
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: Deploy application run: | # Your deployment steps here echo "Deploying..."
- name: Update NeuralRepo idea status if: success() run: | curl -s -X PATCH "https://neuralrepo.com/api/v1/ideas/${{ vars.NEURALREPO_IDEA_ID }}" \ -H "X-API-Key: ${{ secrets.NEURALREPO_API_KEY }}" \ -H "Content-Type: application/json" \ -d '{ "status": "shipped", "add_tags": ["deployed"] }'Search and Annotate on PR
Section titled “Search and Annotate on PR”Search for related ideas when a PR is opened and post them as a comment:
name: NeuralRepo Contexton: pull_request: types: [opened]
jobs: find-context: runs-on: ubuntu-latest steps: - name: Search NeuralRepo for related ideas id: search run: | RESULT=$(curl -s "https://neuralrepo.com/api/v1/ideas/search?query=${{ github.event.pull_request.title }}&limit=3" \ -H "X-API-Key: ${{ secrets.NEURALREPO_API_KEY }}") echo "result=$RESULT" >> "$GITHUB_OUTPUT"
- name: Post comment with related ideas uses: actions/github-script@v7 with: script: | const result = JSON.parse('${{ steps.search.outputs.result }}'); if (result.ideas && result.ideas.length > 0) { const ideas = result.ideas.map(i => `- **#${i.id}**: ${i.title} (${i.status})` ).join('\n'); await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, body: `## Related NeuralRepo Ideas\n${ideas}` }); }JSON Output Mode
Section titled “JSON Output Mode”When parsing API responses in CI scripts, use jq for reliable JSON extraction:
# Create an idea and capture the returned IDIDEA_ID=$(curl -s -X POST "https://neuralrepo.com/api/v1/ideas" \ -H "X-API-Key: $NEURALREPO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"title": "Automated release tracking", "status": "captured"}' \ | jq -r '.id')
echo "Created idea: $IDEA_ID"
# Use the ID in subsequent stepscurl -s -X PATCH "https://neuralrepo.com/api/v1/ideas/$IDEA_ID" \ -H "X-API-Key: $NEURALREPO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"status": "shipped"}'Best Practices
Section titled “Best Practices”- One key per pipeline. Create a separate API key for each CI environment so you can revoke individually.
- Use descriptive tags. Tag CI-created ideas with
ci, the repository name, and the event type (e.g.,release,deploy). - Handle failures gracefully. Wrap NeuralRepo API calls in
if: success()conditions so they only run after your primary workflow succeeds. - Rate limits. The API allows 100 requests per day on the Free plan and 10,000 per day on Pro. This is more than enough for typical CI usage, but avoid calling the API in tight loops.