mirror of https://github.com/vuejs/core.git
workflow only verify commit message on main branch
This commit is contained in:
parent
1058ce8e74
commit
058605802e
|
@ -2,6 +2,16 @@
|
|||
import pico from 'picocolors'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import { exec } from './utils.js'
|
||||
|
||||
main()
|
||||
|
||||
async function main() {
|
||||
const { stdout: branch } = await exec('git', ['branch', '--show-current'])
|
||||
// only verify commit message on main and minor branches
|
||||
if (branch !== 'main' && branch !== 'minor') {
|
||||
return
|
||||
}
|
||||
|
||||
const msgPath = path.resolve('.git/COMMIT_EDITMSG')
|
||||
const msg = readFileSync(msgPath, 'utf-8').trim()
|
||||
|
@ -26,3 +36,4 @@ if (!commitRE.test(msg)) {
|
|||
)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue