atlassian / lerna-semantic-release

📦:🛠✨💥 – fully automated package publishing
https://www.npmjs.com/package/lerna-semantic-release
679 stars 42 forks source link

feat: add env var override for get-last-release use local strategy #82

Open junosuarez opened 7 years ago

junosuarez commented 7 years ago

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!