feat: default Git environment variables#7
Merged
Conversation
|
🎉 This PR is included in version 1.0.0-beta.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the default behavior of
@semantic-release/coreto 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:
applyGitEnvDefaultsfunction inindex.jsthat sets default Git environment variables (such asGIT_AUTHOR_NAME,GIT_COMMITTER_NAME,GIT_ASKPASS, andGIT_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]COMMIT_NAMEandCOMMIT_EMAILconstants for use in setting these defaults. [1] [2]Documentation updates:
README.mdto 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:
These changes make it easier and safer to compose
@semantic-release/corein CI environments by ensuring that Git commands run with appropriate defaults, while still allowing full customization when needed.