fix Branch naming
parent
a09742ddba
commit
592b6c1a95
|
@ -13,7 +13,7 @@ module.exports = {
|
||||||
const isBug = issue.labels.length && !!issue.labels.find(label => label.name === 'bug')
|
const isBug = issue.labels.length && !!issue.labels.find(label => label.name === 'bug')
|
||||||
const prefix = isBug ? 'bugfix' : 'feature'
|
const prefix = isBug ? 'bugfix' : 'feature'
|
||||||
const branch = issue.title.replace(/[^a-z0-9\s]/gi, '').replaceAll(' ', '-')
|
const branch = issue.title.replace(/[^a-z0-9\s]/gi, '').replaceAll(' ', '-')
|
||||||
const branchName = `${prefix}/${issue.number}-${branch}`
|
const branchName = `${prefix}/ISS-${issue.number}-${branch}`
|
||||||
|
|
||||||
log(`Created branch name ${branchName} in ${repository.full_name}`)
|
log(`Created branch name ${branchName} in ${repository.full_name}`)
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ module.exports = {
|
||||||
const { ref, repository } = req.body
|
const { ref, repository } = req.body
|
||||||
log(`Try referencing ref ${ref} to issue`)
|
log(`Try referencing ref ${ref} to issue`)
|
||||||
|
|
||||||
const regex = /refs\/heads\/(feature|bugfix)\/(\d+)-/
|
const regex = /refs\/heads\/(feature|bugfix)\/ISS-(\d+)-/
|
||||||
const issueId = regex.exec(ref)[2]
|
const issueId = regex.exec(ref)[2]
|
||||||
|
|
||||||
const path = `/repos/${repository.full_name}/issues/${issueId}`
|
const path = `/repos/${repository.full_name}/issues/${issueId}`
|
||||||
|
|
Loading…
Reference in New Issue