fix Branch naming
nclazz/gitea-bot/pipeline/head This commit looks good Details

master
Niclas Thobaben 2022-07-09 01:10:30 +02:00
parent 592b6c1a95
commit f92f30b1a7
1 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,9 @@ module.exports = {
const { issue, repository } = req.body
const isBug = issue.labels.length && !!issue.labels.find(label => label.name === 'bug')
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(' ', '-')
.toLowerCase()
const branchName = `${prefix}/ISS-${issue.number}-${branch}`
log(`Created branch name ${branchName} in ${repository.full_name}`)