changelog_output
Advanced tools
Comparing version 1.0.7 to 1.2.0
20
cli.js
@@ -140,6 +140,8 @@ #!/usr/bin/env node | ||
for (let i = 0; i < issues[o].length; i++) { | ||
const currentIssue = issues[o][i] | ||
// const currentIssue = issues[o][i] | ||
const currentIssue = changelogLinkToSlackLink(issues[o][i]) | ||
const issue = { | ||
title: `N/A • ${currentIssue}` | ||
} | ||
@@ -158,2 +160,18 @@ if (WDFRegex.test(currentIssue)) { | ||
function changelogLinkToSlackLink(issue) { | ||
let toChange = issue | ||
const msgRegex = /^([^()]+)\[/g | ||
const hashRegex = /\[([^()]+)\]/g | ||
const urlRegex = /\(([^()]+)\)/g | ||
toChange = toChange.replace('(', '').replace(')', '') | ||
const msg = toChange.match(msgRegex)[0].replace('[', '') | ||
const hash = toChange.match(hashRegex)[0].replace('[', '').replace(']', '') | ||
const url = toChange.match(urlRegex)[0].replace('(', '').replace(')', '') | ||
console.warn('toChange', toChange) | ||
console.warn('msg', msg) | ||
console.warn('hash', hash) | ||
console.warn('url', url) | ||
return `${msg} <${url}|${hash}>` | ||
} | ||
function createOutputFile(data) { | ||
@@ -160,0 +178,0 @@ const blocks = [ |
{ | ||
"name": "changelog_output", | ||
"version": "1.0.7", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -70,2 +70,13 @@ # Changelog Output | ||
https://something.atlassian.net/browse/POS-43 | ||
``` | ||
``` | ||
## NOTES | ||
If this is the first time you are running and just ran the first release command for standard version | ||
you will need to add one small change due to the regex pattern. | ||
This is because the first release does not have anything to compare against and breaks the simple regex being used. | ||
So a simple update is the following: | ||
* Run the first release command for standard version. | ||
* Bottom of the file will output just the starting version `"## 0.0.0"` | ||
* Update to be something like `"## 0.0.0 [0.0.0](some_link) (2022-05-16)"` |
10051
217
81