feat: adding support for extra string
parent
f59f96db02
commit
8333830573
@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env zx
|
|
||||||
|
|
||||||
$.verbose = false;
|
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env zx
|
||||||
|
|
||||||
|
$.verbose = false;
|
||||||
|
|
||||||
|
const git = await import("./lib/git.js")
|
||||||
|
|
||||||
|
const issueNumber = process.argv[3];
|
||||||
|
const issue = await $`gh issue view ${issueNumber} --repo cosmos/ibc-go --json title`;
|
||||||
|
const issueTitle = JSON.parse(issue).title;
|
||||||
|
const sanitizedTitle = git.sanitizeIssueTitle(issueTitle);
|
||||||
|
|
||||||
|
await $`gh pr create --web --title ${issueTitle} --base main`
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
module.exports = {
|
||||||
|
sanitizeIssueTitle(issueTitle) {
|
||||||
|
let sanitizedTitle = issueTitle.trim().toLowerCase()
|
||||||
|
sanitizedTitle = sanitizedTitle.replaceAll(".", "")
|
||||||
|
sanitizedTitle = sanitizedTitle.replaceAll(",", "")
|
||||||
|
sanitizedTitle = sanitizedTitle.replaceAll("`", "")
|
||||||
|
sanitizedTitle = sanitizedTitle.replaceAll(":", "")
|
||||||
|
sanitizedTitle = sanitizedTitle.replaceAll("-", "")
|
||||||
|
|
||||||
|
// replace the spaces with dashes after the dashes are removed.
|
||||||
|
return sanitizedTitle.replaceAll(" ", "-")
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue