Skip to content

Commit

Permalink
Fix regex used on tags for checking whether coverage builds are used (#…
Browse files Browse the repository at this point in the history
…9783)

The `=~` shell operator does not support using `\d` to represent the set
of digits (or any other similar backslash+letter classes). You can
confirm by running

    [[ 1 =~ [0-9] ]]
    echo $?
    [[ 1 =~ \d ]]
    echo $?

which should print `0` and then `1`, indicating that the first match
succeeded and the second failed.

These patterns were working fine before, but now we've reached 2.10 and
the second digit needs to be matched.
  • Loading branch information
dzhu committed Feb 28, 2024
1 parent 162f27b commit 21a7d80
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .circleci/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
echo 'export PATH=/home/circleci/project/cached-deps:$PATH' >> $BASH_ENV
echo 'export PATH=$GOPATH/bin:$PATH' >> $BASH_ENV
if [[ "$CIRCLE_BRANCH" -eq "" ]] && [[ "$CIRCLE_TAG" =~ ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(.*) ]]
if [[ "$CIRCLE_BRANCH" -eq "" ]] && [[ "$CIRCLE_TAG" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(.*) ]]
then
echo 'export TEST_IMAGE_SHA=$CIRCLE_SHA1' >> $BASH_ENV
else
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
echo 'export PATH=$GOPATH/bin:$PATH' >> $BASH_ENV
echo 'export RUNNER_INDEX="$CIRCLE_NODE_INDEX"' >> $BASH_ENV
if [[ "$CIRCLE_BRANCH" -eq "" ]] && [[ "$CIRCLE_TAG" =~ ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(.*) ]]
if [[ "$CIRCLE_BRANCH" -eq "" ]] && [[ "$CIRCLE_TAG" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(.*) ]]
then
echo 'export TEST_IMAGE_SHA=$CIRCLE_SHA1' >> $BASH_ENV
else
Expand Down Expand Up @@ -517,7 +517,7 @@ jobs:
echo 'export PATH=/home/circleci/project/cached-deps:$PATH' >> $BASH_ENV
echo 'export PATH=$GOPATH/bin:$PATH' >> $BASH_ENV
if [[ "$CIRCLE_BRANCH" -eq "" ]] && [[ "$CIRCLE_TAG" =~ ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(.*) ]]
if [[ "$CIRCLE_BRANCH" -eq "" ]] && [[ "$CIRCLE_TAG" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(.*) ]]
then
echo 'export TEST_IMAGE_SHA=$CIRCLE_SHA1' >> $BASH_ENV
else
Expand Down

0 comments on commit 21a7d80

Please sign in to comment.