Created
June 26, 2023 19:39
-
-
Save knaeckeKami/a935c00cae494a92fbae5323c7cff40a to your computer and use it in GitHub Desktop.
check_if_commits.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BRANCH=refs/remotes/origin/main | |
LAST_REV=$(git rev-parse --verify $BRANCH) | |
LAST_TAG=$(git describe --tag --abbrev=0 $LAST_REV) | |
COMMIT_COUNT=$(git rev-list --count $BRANCH $LAST_TAG..) | |
if [ $COMMIT_COUNT = 0 ]; then | |
echo "Nothing to build! No commits since $LAST_TAG on $BRANCH." | |
exit 0; | |
else | |
# do stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment