Skip to content

Commit 0a8b690

Browse files
committed
release.yml: improve tag pattern matching
Improve the tag pattern matching to only match the exact tag patterns we want to release. Previously, the glob-style pattern would match a tag like "v1a.2bc-d.3ef.4" due to the use of the '*' wildcard. However, GitHub Actions has the regex-like '+' available to match one or more of the preceding character set [1], so we can more restrictively match 'v<number>.<number>.<number>' with '[0-9]+' representing '<number>'. To make the tag match slightly more flexible, add a pattern for 'v<number>.<number>.<number>-<string>' (e.g. for "-rc" versions). [1] https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet Signed-off-by: Victoria Dye <[email protected]>
1 parent 4a46973 commit 0a8b690

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v[0-9]*.[0-9]*.[0-9]*' # matches "v<number...>.<number...>.<number>..."
6+
- 'v[0-9]+.[0-9]+.[0-9]+' # matches "v<number>.<number>.<number>"
7+
- 'v[0-9]+.[0-9]+.[0-9]+-*' # matches "v<number>.<number>.<number>-<string>"
78

89
jobs:
910
# Check prerequisites for the workflow

0 commit comments

Comments
 (0)