Ghost/.github/hooks/pre-push

14 lines
422 B
Plaintext
Raw Normal View History

#!/bin/bash
[ -n "$CI" ] && exit 0
UPSTREAM=${GHOST_UPSTREAM:-origin}
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
# $1 is the name of the remote to which the push is being done
if [ "$1" = "$UPSTREAM" ] && [ "$GIT_BRANCH" = "main" ]; then
printf " Pushing to \033[0;32m$GIT_BRANCH\033[0m branch requires some checks in advance\n"
yarn lerna run --include-dependents --since $1/$GIT_BRANCH test:unit
fi