booxmedialtd / ws-action-parse-semver

GitHub action for parsing a tag following semantic versioning.
MIT License
11 stars 6 forks source link

fullVersion does not result as the documentation states #14

Closed julianhille closed 2 years ago

julianhille commented 2 years ago

The documentation does state that a parse of '3.4.5-alpha+1.2' would result in the property of fullversion beeing the same string. https://github.com/booxmedialtd/ws-action-parse-semver#fullversion

But the parser crunched down to:

parseSemver = require('semver/functions/parse');
semVerString = parseSemver('3.4.5-alpha+1.2');
const parsedSemver = parseSemver(semVerString);
console.log('this should be the fullversion:', parsedSemver.version);

results in: this should be the fullversion: 3.4.5-alpha

which is obviously missing the +1.2 Looking at the full semver object we might wanted to use the raw property instead:

console.log(parseSemver('3.4.5-alpha+1.2'));
SemVer {
  options: {},
  loose: false,
  includePrerelease: false,
  raw: '3.4.5-alpha+1.2',
  major: 3,
  minor: 4,
  patch: 5,
  prerelease: [ 'alpha' ],
  build: [ '1', '2' ],
  version: '3.4.5-alpha'
})
tlangens commented 2 years ago

Fixed in #18