chore: Added logic to skip build script
This commit is contained in:
parent
d10ef18e7a
commit
b1d2d5a21b
1 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
import process from 'node:process'
|
import process from 'node:process'
|
||||||
import { execSync } from 'child_process'
|
import { execSync } from 'child_process'
|
||||||
|
|
||||||
|
const branchesToNeverBuild = ['i18n']
|
||||||
|
|
||||||
export const shouldSkipBuild = (siteName, checkFolders = '../shared .') => {
|
export const shouldSkipBuild = (siteName, checkFolders = '../shared .') => {
|
||||||
console.log('Skip build script version 1.1.0')
|
console.log('Skip build script version 1.1.0')
|
||||||
|
|
||||||
|
@ -23,6 +25,11 @@ export const shouldSkipBuild = (siteName, checkFolders = '../shared .') => {
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not build branches that should never be build
|
||||||
|
for (const skip of branchesToNeverBuild) {
|
||||||
|
if (branch.match(skip)) return process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
// Do not build commits that have [vercel skip] in the message
|
// Do not build commits that have [vercel skip] in the message
|
||||||
if (process.env.VERCEL_GIT_COMMIT_MESSAGE.match(/\[vercel skip\]/)) {
|
if (process.env.VERCEL_GIT_COMMIT_MESSAGE.match(/\[vercel skip\]/)) {
|
||||||
console.log('🛑 - Commit message includes [vercel skip] - Do not build')
|
console.log('🛑 - Commit message includes [vercel skip] - Do not build')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue