Testing semantic-release with Dry Run Mode

Learn how to test your semantic-release configuration without actually publishing anything. Use dry-run mode and CI verification to validate your setup before going live.

Specialized Configuration

Detailed Explanation

Testing Your Configuration Safely

Before enabling semantic-release in production, you can test the entire workflow without publishing, tagging, or modifying any files using the dry-run flag.

Running a Dry Run

npx semantic-release --dry-run

This command:

  • Analyzes your commits since the last release
  • Determines what the next version would be
  • Generates release notes
  • Shows what each plugin would do
  • Does not publish, tag, commit, or modify anything

Dry Run Configuration

You can also set dry run in your config file for testing:

{
  "branches": ["main"],
  "dryRun": true,
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/npm",
    "@semantic-release/github"
  ]
}

CI Environment Detection

semantic-release checks for CI environment variables before running. For local testing, you may need to set:

CI=true npx semantic-release --dry-run

Verify Conditions

The verifyConditions step checks that all required tokens and permissions are available. During dry run, some plugins still verify conditions:

  • npm: Checks NPM_TOKEN is valid
  • github: Checks GITHUB_TOKEN has necessary permissions

Common Testing Workflow

  1. Configure semantic-release in a feature branch
  2. Run npx semantic-release --dry-run --branches feature-branch
  3. Review the output to verify correct version bumps
  4. Check that release notes include the expected commits
  5. Merge to main and let the real release happen

Debug Output

For detailed debugging information:

DEBUG=semantic-release:* npx semantic-release --dry-run

This shows the internal decision-making process, including which commits matched which rules.

Use Case

Teams setting up semantic-release for the first time who want to validate their configuration, verify token permissions, and preview version bumps before enabling automated publishing in production CI pipelines.

Try It — Semantic Release Config Builder

Open full tool