Created
May 12, 2020 12:46
-
-
Save merltron-pa/9be53081b426ae0276a170e9560df44d to your computer and use it in GitHub Desktop.
Example workflow used in this article: https://medium.com/@merlin.pav/122c653c0b09?source=friends_link&sk=4ca7d4ab89ce41f2118a1d9aad50807d
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
#!/bin/bash | |
set -e | |
set -o pipefail | |
echo "Start validation $1" | |
BRANCH=$(git branch -r --contains ${GITHUB_SHA} | grep "") | |
RELEASE_VERSION=$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g" | sed -e "s/\//-/g") | |
MASTER_BRANCH_NAME='origin/master' | |
RELEASE_PREFIX='r-' | |
if [[ "${INPUT_PRERELEASE}" != true ]] && [[ "$BRANCH" == *"$MASTER_BRANCH_NAME"* ]] && [[ "$RELEASE_VERSION" == "$RELEASE_PREFIX"* ]]; then | |
echo "Release tag validation succeeded!" | |
exit 0 | |
elif [[ "${INPUT_PRERELEASE}" == true ]]; then | |
echo "Pre-Release tag validation succeeded!" | |
exit 0 | |
else | |
echo "Tag validation failed!" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment