changelog-machine 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,9 +28,16 @@ const ticketRecognition = (commitMessage) => {
28
28
  };
29
29
  const createReleaseSubtitle = (group, repository) => {
30
30
  const latestTag = 'v' + process.env.npm_package_version;
31
- const latestVersion = latestTag === group.previousTag ? 'Unreleased changes' : latestTag;
32
- const subtitleLinkText = group.tag === 'HEAD' ? latestVersion : group.tag;
33
- const subtitleLink = `${repository}/compare/${group.previousTag}...${group.tag}`;
31
+ const unreleasedChanges = latestTag === group.previousTag;
32
+ const latestVersion = unreleasedChanges ? 'Unreleased changes' : latestTag;
33
+ const tagIsHead = group.tag === 'HEAD';
34
+ const subtitleLinkText = tagIsHead ? latestVersion : group.tag;
35
+ const subtitleLinkCurrentTag = tagIsHead
36
+ ? unreleasedChanges
37
+ ? 'HEAD'
38
+ : latestTag
39
+ : group.tag;
40
+ const subtitleLink = `${repository}/compare/${group.previousTag}...${subtitleLinkCurrentTag}`;
34
41
  const subtitle = `${createLink(subtitleLinkText, subtitleLink)}`;
35
42
  return `#### ${repository ? subtitle : subtitleLinkText}`;
36
43
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "changelog-machine",
3
3
  "displayName": "Changelog Machine",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "description": "Changelog generator based on Git commit messages and tags",
6
6
  "main": "./lib/index.js",
7
7
  "module": "./lib/index.js",