Skip to content

Conversation

@betegon
Copy link
Member

@betegon betegon commented Dec 3, 2025

Detect GitHub Actions CI at runtime and report Sentry environment as github-ci instead of production.

This allows distinguishing CI test runs from actual production usage in Sentry dashboards.

  • Adds runtime check for CI and GITHUB_ACTIONS environment variables
  • These variables are not replaced at build time, so they work as true runtime checks
  • Browser context will correctly fall back to production since these env vars won't exist there

@vercel
Copy link

vercel bot commented Dec 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
spotlightjs Ready Ready Preview Comment Dec 3, 2025 3:54pm

Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this will also report GitHub CI if people start using Spotlight in CI (one of our potential future use cases). Might be better to find a few more markers to mark this as our CI.

Btw there's this for a more generic approach: https://www.npmjs.com/package/is-in-ci

@betegon betegon merged commit d6f3627 into main Dec 3, 2025
35 of 38 checks passed
@betegon betegon deleted the bete/fix/sentry-github-ci-environment branch December 3, 2025 17:41
MathurAditya724 pushed a commit that referenced this pull request Dec 4, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## @spotlightjs/[email protected]

### Patch Changes

- Report `github-ci` environment to Sentry when running in GitHub
Actions CI ([#1178](#1178))

- Fix `npx @spotlightjs/spotlight` fail
([#1181](#1181))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants