mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Fixed pre-push
hook running when pushing to fork
- this prevents the unit tests running if you're pushing to a fork, which we don't care about because it doesn't block the upstream `main`
This commit is contained in:
parent
55741c8bdc
commit
846a9cdafc
1 changed files with 6 additions and 3 deletions
9
.github/hooks/pre-push
vendored
9
.github/hooks/pre-push
vendored
|
@ -2,9 +2,12 @@
|
|||
|
||||
[ -n "$CI" ] && exit 0
|
||||
|
||||
UPSTREAM=${GHOST_UPSTREAM:-origin}
|
||||
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [ "$GIT_BRANCH" = "main" ]; then
|
||||
printf "ℹ️ Pushing to \033[0;42m$GIT_BRANCH\033[0m branch requires some checks in advance\n"
|
||||
|
||||
yarn lerna run --include-dependents --since ${GHOST_UPSTREAM:-origin}/$GIT_BRANCH test:unit
|
||||
# $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
|
||||
|
|
Loading…
Add table
Reference in a new issue