#!/bin/bash set -e # --yes gets passed in by .travis.yml, # which makes this easier to test locally args=$@ branch=$TRAVIS_BRANCH if [[ "$TRAVIS_EVENT_TYPE" = "pull_request" ]]; then target_branch=$TRAVIS_PULL_REQUEST_BRANCH # if the *source* branch begins with "release" if [[ "$branch" =~ ^release ]]; then script/release-candidate $args # otherwise, if the *target* branch is dev elif [[ "$target_branch" = "dev" ]]; then script/release-pr $args else echo "⚠️ This is a PR, but '$branch' isn't a release branch" echo " and '$target_branch' isn't a recognized target branch." exit 1 fi elif [[ "$branch" = "master" ]]; then script/release $args else echo "⚠️ This isn't a PR and '$branch' isn't a release branch." exit 1 fi