Use type label as prefix if not, use feature/bugfix
nclazz/gitea-bot/pipeline/head This commit looks good
Details
nclazz/gitea-bot/pipeline/head This commit looks good
Details
parent
bb2c041284
commit
308e83f408
|
@ -11,10 +11,7 @@ module.exports = {
|
|||
}
|
||||
const { issue, repository } = req.body
|
||||
const isBug = issue.labels.length && !!issue.labels.find(label => label.name.includes('bug'))
|
||||
const typePrefix = issue.labels.length && issue.labels.find(label => label.name.startsWith('type'))
|
||||
console.log(`Found type prefix`, typePrefix)
|
||||
const prefix = (typePrefix ? typePrefix : isBug ? 'bugfix' : 'feature').replaceAll(/[^a-z0-9\s]/gi, '')
|
||||
console.log(`Create branch prefix`, prefix)
|
||||
const prefix = isBug ? 'bugfix' : 'feature'
|
||||
const branch = issue.title.replace(/[^a-z0-9\s]/gi, '')
|
||||
.replaceAll(' ', '-')
|
||||
.toLowerCase()
|
||||
|
|
Loading…
Reference in New Issue