shipshapecode / ember-cli-release

Ember CLI addon for versioned release management
MIT License
90 stars 18 forks source link

Ignore invalid SemVer tags when using `semver` strategy #65

Closed johnmartel closed 6 years ago

johnmartel commented 7 years ago

The documentation does not imply that invalid Semver tags should result in a crash when using the semver strategy, but merely that these tags should be ignored:

 Find the latest tag that is SemVer compliant and increment its PATCH version

This fix simply ensures that only valid semver tags are considered. This was not the case because there are 3 parameters provided to the Array.filter callback, the second being an int representing the index of the element being filtered. The problem is that the semver.valid function accepts two parameters and if the second is truthy, it will use the LOOSE regex to validate the version, which may yield unwanted results.