Add bug branch prefix for any label with the word 'bug'
nclazz/gitea-bot/pipeline/head This commit looks good Details

master
Niclas Thobaben 2023-05-26 23:55:15 +02:00
parent 39e19dc8fa
commit 72d41d1218
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ module.exports = {
return
}
const { issue, repository } = req.body
const isBug = issue.labels.length && !!issue.labels.find(label => label.name === 'bug' || label.name === 'type: bug')
const isBug = issue.labels.length && !!issue.labels.find(label => label.name.includes('bug'))
const prefix = isBug ? 'bugfix' : 'feature'
const branch = issue.title.replace(/[^a-z0-9\s]/gi, '')
.replaceAll(' ', '-')
@ -36,4 +36,4 @@ module.exports = {
.catch(reason => reason)
}
}
}