2023-03-22 18:30:40 +03:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
[ -n "$CI" ] && exit 0
|
|
|
|
|
|
2023-03-23 19:31:06 +03:00
|
|
|
|
UPSTREAM=${GHOST_UPSTREAM:-origin}
|
2023-03-22 18:30:40 +03:00
|
|
|
|
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
|
|
|
|
2023-03-23 19:31:06 +03:00
|
|
|
|
# $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
|
2023-03-22 18:30:40 +03:00
|
|
|
|
fi
|