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

master
Niclas Thobaben 2022-07-09 01:09:29 +02:00
parent a09742ddba
commit 592b6c1a95
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ module.exports = {
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 branchName = `${prefix}/${issue.number}-${branch}`
const branchName = `${prefix}/ISS-${issue.number}-${branch}`
log(`Created branch name ${branchName} in ${repository.full_name}`)

View File

@ -13,7 +13,7 @@ module.exports = {
const { ref, repository } = req.body
log(`Try referencing ref ${ref} to issue`)
const regex = /refs\/heads\/(feature|bugfix)\/(\d+)-/
const regex = /refs\/heads\/(feature|bugfix)\/ISS-(\d+)-/
const issueId = regex.exec(ref)[2]
const path = `/repos/${repository.full_name}/issues/${issueId}`