Use type label as prefix if not, use feature/bugfix
nclazz/gitea-bot/pipeline/head This commit looks good Details

master
Niclas Thobaben 2023-05-27 00:37:42 +02:00
parent 72d41d1218
commit e2d1295606
1 changed files with 2 additions and 1 deletions

View File

@ -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()