Skip to content

Commit

Permalink
fix(ci): Regex correctly matches tags when doing release
Browse files Browse the repository at this point in the history
Before this patch, a branch name like `1.0.0-testing-something` was
considered as being the source of a release.

With this new regex we ensure we never use a wrong tag/branch to create
a release.
  • Loading branch information
jubianchi committed Nov 17, 2020
1 parent 958da6c commit 847bd53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
echo ::set-output name=VERSION::${VERSION}
DOING_RELEASE=$(echo $VERSION | grep -c '[0-9]\+\.[0-9]\+\.[0-9]\+\(-.*\)\?' || true)
DOING_RELEASE=$(echo $VERSION | grep -c '^[0-9]\+\.[0-9]\+\.[0-9]\+\(-\([a-zA-Z]\+\)?[0-9]*\)\?$' || true)
echo ::set-output name=DOING_RELEASE::${DOING_RELEASE}
echo $VERSION
echo $DOING_RELEASE
Expand Down

0 comments on commit 847bd53

Please sign in to comment.