2 # We want to make sure all PRs are targeting the right branch when they're
3 # opened, otherwise we risk (for example) to land a beta-specific change to the
4 # master branch. This script ensures the branch of the PR matches the channel.
9 source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
11 if isCiBranch auto || isCiBranch try; then
12 echo "channel verification is only executed on PR builds"
16 channel=$(cat "$(ciCheckoutPath)/src/ci/channel")
19 channel_branch="master"
25 channel_branch="stable"
28 echo "error: unknown channel defined in src/ci/channel: ${channel}"
32 branch="$(ciBaseBranch)"
33 if [[ "${branch}" != "${channel_branch}" ]]; then
34 echo "error: PRs changing the \`${channel}\` channel should be sent to the \
35 \`${channel_branch}\` branch!"