SE

sentry-ci-integration

Integrates Sentry into CI/CD to automate release creation and source map uploading.

Install

mkdir -p .claude/skills/sentry-ci-integration && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3091" && unzip -o skill.zip -d .claude/skills/sentry-ci-integration && rm skill.zip

Installs to .claude/skills/sentry-ci-integration

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Integrate Sentry into CI/CD pipelines for automated release creation,
69 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Create Sentry releases in CI/CD pipelines
  • Upload source maps to Sentry
  • Associate Git commits with Sentry releases
  • Record deployments to Sentry environments
  • Integrate with GitHub Actions, GitLab CI, and CircleCI
  • Use build tool plugins for source map uploads

How it works

The skill uses sentry-cli commands or build tool plugins to create a release, associate commits, upload source maps, finalize the release, and record the deployment within a CI/CD pipeline.

Inputs & outputs

You give it
CI/CD pipeline configuration and build artifacts
You get back
Automated Sentry releases with associated commits, source maps, and deployment records

When to use sentry-ci-integration

  • Automate Sentry releases
  • Upload source maps in CI
  • Associate commits with deployments
  • Track production errors

About this skill

Sentry CI Integration

Overview

Sentry releases connect errors to the code that caused them. Automating release creation in CI/CD ensures every deploy has commit association (suspect commits), source maps for readable stack traces, and deployment tracking across environments. This skill covers sentry-cli commands, the official GitHub Action, build tool plugins (@sentry/webpack-plugin, @sentry/vite-plugin, @sentry/esbuild-plugin), and multi-platform CI configurations.

Prerequisites

  • Sentry account with a project at sentry.io
  • SENTRY_AUTH_TOKEN — generate at sentry.io/settings/auth-tokens/ with scopes project:releases and org:read
  • SENTRY_ORG and SENTRY_PROJECT environment variables matching your organization and project slugs
  • Source maps generated during your build step (devtool: 'source-map' in webpack, build.sourcemap: true in Vite)
  • Git integration installed in Sentry (sentry.io/settings/integrations/ — GitHub, GitLab, or Bitbucket) for commit association
  • sentry-cli available via npm install -g @sentry/cli, npx @sentry/cli, or the getsentry/sentry-cli Docker image

Instructions

Step 1 — Configure Environment Variables and Auth Token

Set up the three required environment variables in your CI platform. Every sentry-cli command reads these automatically.

# GitHub Actions — add as repository secrets:
#   Settings > Secrets and variables > Actions > New repository secret
SENTRY_AUTH_TOKEN=sntrys_eyJ...     # Internal integration token from sentry.io/settings/auth-tokens/
SENTRY_ORG=my-org                    # Organization slug (visible in sentry.io URL)
SENTRY_PROJECT=my-project            # Project slug (Settings > Projects > project name)

# Required token scopes:
#   project:releases   — create releases, upload source maps, record deploys
#   org:read           — read organization data for --auto commit association

# GitLab CI — add under Settings > CI/CD > Variables (masked + protected)
# CircleCI — add under Project Settings > Environment Variables

For build tool plugins (@sentry/webpack-plugin, @sentry/vite-plugin, @sentry/esbuild-plugin), the same three environment variables are read automatically. No additional configuration needed.

Verify your token works locally before committing CI configuration:

export SENTRY_AUTH_TOKEN=sntrys_eyJ...
export SENTRY_ORG=my-org
export SENTRY_PROJECT=my-project
npx @sentry/cli info
# Should print organization name, project, and CLI version

Step 2 — Create the CI Release Pipeline

The release pipeline follows five commands in sequence: create release, associate commits, upload source maps, finalize release, and record deployment.

# The five sentry-cli commands that form a complete release pipeline:
VERSION=$(git rev-parse HEAD)

# 1. Create a new release (idempotent — safe to re-run)
sentry-cli releases new "$VERSION"

# 2. Associate commits for suspect commit detection (requires Git integration)
sentry-cli releases set-commits "$VERSION" --auto

# 3. Upload source maps with validation
sentry-cli releases files "$VERSION" upload-sourcemaps ./dist \
  --url-prefix '~/' \
  --validate

# 4. Mark the release as complete
sentry-cli releases finalize "$VERSION"

# 5. Record the deployment environment
sentry-cli releases deploys "$VERSION" new -e production

The --validate flag on source map upload checks that each .map file references a valid source file and that sourceMappingURL comments point to uploaded artifacts. Always use it in CI to catch mismatches early.

The --url-prefix must match the URL path where your JavaScript files are served. For example, if your app serves https://example.com/assets/app.js, use --url-prefix '~/assets/'. The ~/ prefix is shorthand for your domain root.

Step 3 — Integrate Build Tool Plugins (Alternative to sentry-cli)

Build tool plugins handle source map upload during the build step itself, eliminating the need for separate sentry-cli commands. They automatically create releases, upload maps, and optionally delete .map files from the output so they are never served to clients.

Vite (@sentry/vite-plugin):

// vite.config.js
import { sentryVitePlugin } from '@sentry/vite-plugin';

export default {
  build: {
    sourcemap: true, // Required — plugin needs source maps to upload
  },
  plugins: [
    sentryVitePlugin({
      org: process.env.SENTRY_ORG,
      project: process.env.SENTRY_PROJECT,
      authToken: process.env.SENTRY_AUTH_TOKEN,
      release: {
        name: process.env.GITHUB_SHA || process.env.CI_COMMIT_SHA,
        setCommits: { auto: true },
        deploy: { env: process.env.NODE_ENV || 'production' },
      },
      sourcemaps: {
        filesToDeleteAfterUpload: ['./dist/**/*.map'],
      },
    }),
  ],
};

Webpack (@sentry/webpack-plugin):

// webpack.config.js
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');

module.exports = {
  devtool: 'source-map',
  plugins: [
    sentryWebpackPlugin({
      org: process.env.SENTRY_ORG,
      project: process.env.SENTRY_PROJECT,
      authToken: process.env.SENTRY_AUTH_TOKEN,
      release: {
        name: process.env.GITHUB_SHA || process.env.CI_COMMIT_SHA,
        setCommits: { auto: true },
        deploy: { env: 'production' },
      },
      sourcemaps: {
        assets: ['./dist/**'],
        filesToDeleteAfterUpload: ['./dist/**/*.map'],
      },
    }),
  ],
};

esbuild (@sentry/esbuild-plugin):

// build.mjs
import { sentryEsbuildPlugin } from '@sentry/esbuild-plugin';
import esbuild from 'esbuild';

await esbuild.build({
  entryPoints: ['./src/index.ts'],
  bundle: true,
  sourcemap: true,
  outdir: './dist',
  plugins: [
    sentryEsbuildPlugin({
      org: process.env.SENTRY_ORG,
      project: process.env.SENTRY_PROJECT,
      authToken: process.env.SENTRY_AUTH_TOKEN,
      release: {
        name: process.env.GITHUB_SHA,
      },
    }),
  ],
});

Install the plugin for your build tool:

# Pick one based on your build tool:
npm install --save-dev @sentry/vite-plugin
npm install --save-dev @sentry/webpack-plugin
npm install --save-dev @sentry/esbuild-plugin

Output

After completing CI integration, every deploy produces:

  • A Sentry release named by commit SHA, visible at sentry.io under Releases
  • Source maps uploaded and validated, enabling readable JavaScript stack traces
  • Commits associated with the release, powering suspect commit detection in issue details
  • A deployment record in Sentry with the target environment (production, staging, etc.)
  • Source map files optionally deleted from build output when using build tool plugins

Verify the release was created:

sentry-cli releases list --org my-org --project my-project
# Shows recent releases with commit counts and deploy environments

Error Handling

ErrorCauseSolution
error: API request failed: 401 UnauthorizedAuth token invalid, expired, or missingRegenerate at sentry.io/settings/auth-tokens/ and update CI secret
error: could not determine any commits to associateGit integration not installed or shallow cloneInstall GitHub/GitLab integration at sentry.io/settings/integrations/ and set fetch-depth: 0 in checkout
error: could not find referenced source mapsourceMappingURL comment missing from JS filesVerify devtool: 'source-map' (webpack) or build.sourcemap: true (Vite) is set
Source maps uploaded but stack traces still minified--url-prefix does not match served URL pathsOpen browser DevTools Network tab, check the URL path of your JS files, and set --url-prefix to match
error: release already existsRe-running pipeline for same commitSafe to ignore — sentry-cli releases new is idempotent; subsequent commands update the existing release
error: org not foundSENTRY_ORG does not match organization slugCheck your org slug at sentry.io/settings/ (it appears in the URL)
413 Request Entity Too LargeSource map bundle exceeds 40 MB upload limitSplit source maps per entry point or exclude vendor maps with --ignore flag
Build tool plugin silently skips uploadSENTRY_AUTH_TOKEN not set in CI environmentThe plugins no-op when auth token is missing; ensure the secret is available to the build step

Examples

Example A — GitHub Actions Full Release Workflow

# .github/workflows/deploy.yml
name: Deploy with Sentry Release

on:
  push:
    branches: [main]

env:
  SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
  SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
  SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0  # Full git history for commit association

      - uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: Install dependencies
        run: npm ci

      - name: Build with source maps
        run: npm run build

      - name: Create Sentry release and upload source maps
        run: |
          VERSION="${{ github.sha }}"
          npx @sentry/cli releases new "$VERSION"
          npx @sentry/cli releases set-commits "$VERSION" --auto
          npx @sentry/cli releases files "$VERSION" upload-sourcemaps ./dist \
            --url-prefix '~/' \
            --validate
          npx @sentry/cli releases finalize "$VERSION"
          npx @sentry/cli releases deploys "$VERSION" new -e production

      - name: Deploy application
        run: npm run deploy

Using the official GitHub Action as a simpler alternative:

      - name: Create Sentry release
        uses: getsentry/action-release@v1
        env:
          SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
          SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
          SENTRY_PROJECT

---

*Content truncated.*

Prerequisites

Sentry account with a projectSENTRY_AUTH_TOKEN with project:releases and org:read scopesSENTRY_ORG and SENTRY_PROJECT environment variablesSource maps generated during the build step

How it compares

This skill automates the entire Sentry release and source map management process within CI/CD, unlike manual Sentry CLI execution or separate build steps.

Compared to similar skills

sentry-ci-integration side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
sentry-ci-integration (this skill)125dReviewIntermediate
cloud-functions12moReviewIntermediate
genkit-infra-expert125dReviewAdvanced
validate-release-ready-image-cidev03moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

cloud-functions

TencentCloudBase

Complete guide for CloudBase cloud functions development - runtime selection, deployment, logging, invocation, and HTTP access configuration.

18

genkit-infra-expert

jeremylongshore

Execute use when deploying Genkit applications to production with Terraform. Trigger with phrases like "deploy genkit terraform", "provision genkit infrastructure", "firebase functions terraform", "cloud run deployment", or "genkit production infrastructure". Provisions Firebase Functions, Cloud Run services, GKE clusters, monitoring dashboards, and CI/CD for AI workflows.

15

validate-release-ready-image-cidev

Azure

Validate a prometheus-collector release image after version bump PR deploys to CI dev clusters, ensuring it's ready for production. Covers both the automated CI pipeline flow and manual validation steps. Use when "validate release image", "check CI test results", "debug testkube failures", or "is th

00

deploy-preflight

vincentxuu

Pre-deploy verification for the quidproquo Cloudflare Workers site — run lint / astro check / tests / check:references, sanity-check git state and wrangler config, and produce a go/no-go report before `pnpm deploy`. Does NOT deploy. Use when user says 準備 deploy / 上線前檢查 / preflight / 部署前看一下.

00

openclaw-4656-a-b-rollout-governance

zwright8

A/B Rollout Governance for product management execution. Use when work requires a/b rollout governance for product management execution with guardrails, traceable execution, and measurable outcomes.

00

gcp-cloud-run

aj-geddes

Deploy containerized applications on Google Cloud Run with automatic scaling, traffic management, and service mesh integration. Use for container-based serverless computing.

5107

Search skills

Search the agent skills registry