Skip to main content

CI/CD Integration

Constellation indexes capture the structural intelligence of your codebase at a point in time. As code changes, the index needs to stay current so AI assistants have an accurate understanding of your project. CI/CD pipelines automate this, ensuring your index is always up to date without manual intervention.

Why Automate Indexing?​

Manual indexing with const index --full works for initial setup and ad-hoc updates, but it relies on developers remembering to re-index after changes. Automated CI/CD indexing solves this:

  • Always current — Every merge to your main branch triggers a re-index automatically
  • Zero friction — Developers don't need to think about indexing; it just happens
  • Consistent — The same process runs every time, eliminating human error
  • Privacy preserved — Only structural metadata is extracted, never source code — same as local indexing

Best Practices​

Index on every push to main​

The most important pattern: trigger indexing whenever code lands on your default branch. This keeps the index aligned with the latest state of your project.

on:
push:
branches: [main]

Store access key as a secrets​

Never hardcode your Constellation access key. Use your CI platform's secrets management:

  • GitHub Actions: Repository secrets (Settings > Secrets and variables > Actions)
  • GitLab CI: CI/CD variables (Settings > CI/CD > Variables, masked and protected)
  • Other platforms: Use the equivalent encrypted secrets mechanism

Use minimal permissions​

Constellation only needs to read your source files for metadata extraction. Grant the minimum permissions required — typically read-only access to repository contents.

Keep the CLI version current​

Constellation's CI integrations automatically use the latest CLI version, ensuring you always have the newest language support and performance improvements.

Available Integrations​

PlatformIntegrationStatus
GitHub ActionsShiftinBits/constellation-github@v1Available
GitLab CIshiftinbits/constellation-gitlab/constellation-index@1Available
Other CI platformsManual CLI installationGuide coming soon

For platforms without a dedicated integration, you can install the Constellation CLI directly in your pipeline and run const index --full.