2020-03-12 16:02:56 -05:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
GIT_RELEASE_BOT_NAME=${GIT_RELEASE_BOT_NAME:?GIT_RELEASE_BOT_NAME must be provided}
|
|
|
|
GITHUB_SHA=${GITHUB_SHA:?GITHUB_SHA must be provided}
|
|
|
|
|
|
|
|
# avoid the release loop by checking if the latest commit is a release commit
|
2020-03-12 18:23:00 -05:00
|
|
|
readonly local last_release_commit_hash=$(git log --grep='\[maven-release-plugin\] prepare release' --pretty=format:"%H" -1)
|
|
|
|
|
2020-03-12 16:02:56 -05:00
|
|
|
echo "Last $GIT_RELEASE_BOT_NAME commit: ${last_release_commit_hash}"
|
|
|
|
echo "Current commit: ${GITHUB_SHA}"
|
|
|
|
if [[ "${last_release_commit_hash}" = "${GITHUB_SHA}" ]]; then
|
|
|
|
echo "Skipping for $GIT_RELEASE_BOT_NAME commit"
|
|
|
|
exit 1
|
|
|
|
fi
|