1
0
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:
Gary Katsevman
2018-01-24 13:47:07 -05:00
committed by GitHub
parent 673c231684
commit ddfaf14b00
3 changed files with 20 additions and 1066 deletions

View File

@ -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