add commit message flag to skip a build. include core in lab build triggers
This commit is contained in:
parent
affc6b6c4e
commit
18d998748d
2 changed files with 14 additions and 2 deletions
|
@ -19,10 +19,16 @@ export const shouldSkipBuild = (siteName, checkFolders = '../shared .') => {
|
||||||
const branch = process.env.VERCEL_GIT_COMMIT_REF
|
const branch = process.env.VERCEL_GIT_COMMIT_REF
|
||||||
// Always build develop branch
|
// Always build develop branch
|
||||||
if (branch === 'develop') {
|
if (branch === 'develop') {
|
||||||
console.log('✅ - develop build - Proceed to build')
|
console.log('✅ - Develop build - Proceed to build')
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not build commits that have [vercel skip] in the message
|
||||||
|
if (process.env.VERCEL_GIT_COMMIT_MESSAGE.match('[vercel skip]')) {
|
||||||
|
console.log('🛑 - Commit message includes [vercel skip] - Do not build')
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
// Only build pull requests that made changes to the given site
|
// Only build pull requests that made changes to the given site
|
||||||
if (process.env.VERCEL_GIT_PULL_REQUEST_ID) {
|
if (process.env.VERCEL_GIT_PULL_REQUEST_ID) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
import { shouldSkipBuild } from '../../scripts/skip-build-base.mjs'
|
import { shouldSkipBuild } from '../../scripts/skip-build-base.mjs'
|
||||||
|
|
||||||
const triggerFolders = ['../shared', '../../plugins', '../../designs', '.'].join(' ')
|
const triggerFolders = [
|
||||||
|
'../shared',
|
||||||
|
'../../plugins',
|
||||||
|
'../../designs',
|
||||||
|
'.',
|
||||||
|
'../../packages/core',
|
||||||
|
].join(' ')
|
||||||
|
|
||||||
shouldSkipBuild('Lab', triggerFolders)
|
shouldSkipBuild('Lab', triggerFolders)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue