Fix script argument regex (#4188)

Currently the release tag regex matches against arguments that have `edge` or
`stable` as a substring.

It should only match against arguments that are either `edge` or `stable`.

For example, the graceful error handling is not triggered for the following:
```
❯ bin/create-release-tag edge-20.3.3
bin/create-release-tag: line 92: release_tag: unbound variable
```

This PR fixes the regex so that the above results in graceful error handling.

```
❯ bin/create-release-tag edge-20.3.3
Error: valid release channels: edge, stable
Usage:
    bin/create-release-tag edge
    bin/create-release-tag stable 2.4.8
```
This commit is contained in:
Kevin Leimkuhler 2020-03-19 15:13:17 -07:00 committed by GitHub
parent 8d64f4e135
commit 29db6c12a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ fi
release_channel="$1"
# Verify the release channel.
release_channel_regex="(edge|stable)"
release_channel_regex="^(edge|stable)$"
if [[ ! $release_channel =~ $release_channel_regex ]]; then
echo "Error: valid release channels: edge, stable"
echo "Usage:"