Registering Releases from Your CI/CD Pipeline
Automate release tracking with GitHub Actions, GitLab CI, or any CI/CD system.
Why Register Releases?
Registering releases lets you:
- Correlate errors with specific deployments
- Compare error rates between versions
- Identify which release introduced a regression
- Use AI release impact analysis
Using the SDK
JavaScript
import { registerRelease } from '@lognitor/node';
await registerRelease({
version: '2.1.0',
commitHash: 'a1b2c3d4',
branch: 'main',
deployedBy: 'github-actions',
});GitHub Actions
YAML
- name: Register Release
run: |
curl -s -X POST ${{ secrets.LOGNITOR_API_URL }}/releases/register \
-H "Content-Type: application/json" \
-H "X-API-Key: ${{ secrets.LOGNITOR_API_KEY }}" \
-d '{
"version": "${{ github.sha }}",
"commit_hash": "${{ github.sha }}",
"branch": "${{ github.ref_name }}",
"deployed_by": "github-actions"
}'GitLab CI
YAML
register_release:
stage: deploy
script:
- |
curl -s -X POST ${LOGNITOR_API_URL}/releases/register \
-H "Content-Type: application/json" \
-H "X-API-Key: ${LOGNITOR_API_KEY}" \
-d "{
\"version\": \"${CI_COMMIT_SHA}\",
\"branch\": \"${CI_COMMIT_REF_NAME}\",
\"deployed_by\": \"gitlab-ci\"
}"All subsequent logs automatically include the release context.