Skip to content
Latchkey

semantic-release "not triggered in a known CI environment" in CI

semantic-release uses environment detection to confirm it is running in CI before it publishes. When it cannot detect a known CI environment, it assumes a local run and switches to dry-run mode, so no release is created.

What this error means

The log says "This run was not triggered in a known CI environment, running in dry-run mode" and semantic-release computes but does not publish a version.

semantic-release
[semantic-release] This run was not triggered in a known CI environment, running in dry-run mode.
[semantic-release] Release note for version 1.4.0 (dry-run)

Common causes

The CI environment variable is not set

semantic-release checks variables like CI; a custom or containerized runner that does not set them looks like a local machine.

Running inside a nested tool that strips CI vars

A wrapper (act, a container step) does not propagate the CI environment variables, so detection fails.

How to fix it

Set the CI variable for the step

  1. Export CI=true for the semantic-release step on non-standard runners.
  2. On GitHub-hosted runners CI is already set; check custom images.
  3. Re-run so semantic-release detects CI and publishes.
.github/workflows/release.yml
- run: npx semantic-release
  env:
    CI: true
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Only bypass detection deliberately

If you truly need to force a real run outside CI, pass --no-ci, but prefer setting the environment correctly instead.

Terminal
npx semantic-release --no-ci

How to prevent it

  • Ensure custom runner images set the CI environment variable.
  • Propagate CI variables through container and wrapper steps.
  • Reserve --no-ci for intentional manual releases only.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →