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
72d41d1218
commit
e2d1295606
|
@ -11,7 +11,8 @@ module.exports = {
|
|||
}
|
||||
const { issue, repository } = req.body
|
||||
const isBug = issue.labels.length && !!issue.labels.find(label => label.name.includes('bug'))
|
||||
const prefix = isBug ? 'bugfix' : 'feature'
|
||||
const typePrefix = issue.labels.length && issue.labels.find(label => label.startsWith('type'))
|
||||
const prefix = (typePrefix ? typePrefix : isBug ? 'bugfix' : 'feature').replaceAll(/[^a-z0-9\s]/gi, '')
|
||||
const branch = issue.title.replace(/[^a-z0-9\s]/gi, '')
|
||||
.replaceAll(' ', '-')
|
||||
.toLowerCase()
|
||||
|
|
Loading…
Reference in New Issue