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
e2d1295606
commit
cd1cd31adf
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "gitea-bot",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "Bot for managing gitea issues and projects.",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -12,7 +12,9 @@ module.exports = {
|
|||
const { issue, repository } = req.body
|
||||
const isBug = issue.labels.length && !!issue.labels.find(label => label.name.includes('bug'))
|
||||
const typePrefix = issue.labels.length && issue.labels.find(label => label.startsWith('type'))
|
||||
console.log(`Found type prefix`, typePrefix)
|
||||
const prefix = (typePrefix ? typePrefix : isBug ? 'bugfix' : 'feature').replaceAll(/[^a-z0-9\s]/gi, '')
|
||||
console.log(`Create branch prefix`, prefix)
|
||||
const branch = issue.title.replace(/[^a-z0-9\s]/gi, '')
|
||||
.replaceAll(' ', '-')
|
||||
.toLowerCase()
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
require('dotenv').config()
|
||||
const package = require('../package.json')
|
||||
|
||||
require('./server')
|
||||
|
||||
console.log(`Start giteabot ${package.version}`)
|
||||
|
||||
require('./server')
|
||||
|
|
Loading…
Reference in New Issue