feat: add env var override for get-last-release use local strategy #82
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.
The underlying semantic-release get-last-release plugin has all sorts of problems in their issues tracker about working with private npm registries (and seems slow and non-responsive in merging PRs).
Thankfully, the strategy in lerna-semantic-release-get-last-release of looking at git tags works great! The problem is, with a private npm registry, the package.json doesn't have
private: true
, so this package fails to detect it, and falls back to the default (non-working) strategy.This PR lets you force the local git tag-based get-last-release strategy by setting an env var
GET_LAST_RELEASE_FROM_TAGS
.I didn't see any other convention already established in this project for setting config (or overriding plugins, which would let me make this change in my setup without needing to push it upstream into lerna-semantic-release), so I went with an env var as an easy default - but I'm more than willing to discuss an alternate implementation. What I'm trying to achieve is a way to force lerna-semantic-release to always use the local get-last-version strategy.
Thanks!