mirror of
https://github.com/videojs/video.js.git
synced 2025-07-05 00:58:52 +02:00
chore(docs site): use git commit message for netlify build (#4900)
This commit is contained in:
@ -1,16 +1,12 @@
|
||||
const sh = require('shelljs');
|
||||
const semver = require('semver');
|
||||
|
||||
const GIT_CONTAINS = `git tag --contains ${process.env.COMMIT_REF}`;
|
||||
const output = sh.exec(GIT_CONTAINS, {async: false, silent:true}).stdout;
|
||||
|
||||
console.log('CONTAINS command:', GIT_CONTAINS);
|
||||
console.log('BRANCH:', process.env.BRANCH);
|
||||
console.log('OUTPUT', output);
|
||||
|
||||
const GIT_LOG = `git log --format=%B -n 1 ${process.env.COMMIT_REF}`;
|
||||
const output = sh.exec(GIT_LOG, {async: false, silent:true}).stdout;
|
||||
|
||||
// if we're on master branch and not on a tagged commit,
|
||||
// error the build so it doesn't redeploy the docs
|
||||
if (process.env.BRANCH === 'master' && output === '') {
|
||||
if (process.env.BRANCH === 'master' && semver.valid(output.trim()) === null) {
|
||||
process.exit(1);
|
||||
|
||||
// if we're on any other branch, we can regenerate docs
|
||||
|
Reference in New Issue
Block a user