Skip to content

feat: default Git environment variables#7

Merged
babblebey merged 3 commits into
betafrom
feat/fallback-git-env
Jun 27, 2026
Merged

feat: default Git environment variables#7
babblebey merged 3 commits into
betafrom
feat/fallback-git-env

Conversation

@babblebey

Copy link
Copy Markdown
Member

This pull request updates the default behavior of @semantic-release/core to automatically apply default Git environment variables in CI publishing workflows, unless they are explicitly set by the caller. This change reduces the need for wrapper code to manually set these variables, while still allowing overrides. The documentation and tests have been updated to reflect and verify this new behavior.

The most important changes include:

Core functionality improvements:

  • Added a new applyGitEnvDefaults function in index.js that sets default Git environment variables (such as GIT_AUTHOR_NAME, GIT_COMMITTER_NAME, GIT_ASKPASS, and GIT_TERMINAL_PROMPT) if they are not already present on the environment object. This function is now called automatically in the core execution path. [1] [2]
  • Updated imports to include COMMIT_NAME and COMMIT_EMAIL constants for use in setting these defaults. [1] [2]

Documentation updates:

  • Updated the README.md to clarify that core now applies default Git environment values when missing, and that callers can override these defaults. Several sections were revised to reflect the new behavior and remove the requirement for callers to always set these variables. [1] [2] [3] [4] [5]

Testing improvements:

  • Added integration tests to verify that the core applies default Git environment variables when they are not set by the caller, and that caller-provided values are preserved and not overwritten.

These changes make it easier and safer to compose @semantic-release/core in CI environments by ensuring that Git commands run with appropriate defaults, while still allowing full customization when needed.

@babblebey
babblebey merged commit 70bde3f into beta Jun 27, 2026
8 checks passed
@babblebey
babblebey deleted the feat/fallback-git-env branch June 27, 2026 01:54
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant