Skip to content

Commit

Permalink
fix: change regex to pick up versions not prefixed
Browse files Browse the repository at this point in the history
Signed-off-by: mikeee <[email protected]>
  • Loading branch information
mikeee committed Oct 18, 2023
1 parent 9da5125 commit 2b676fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/check-lint-version/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func getCurrentVersion() (string, error) {
return "", err
}

regex, err := regexp.Compile(`(?:v[\d+.]+[\d])`)
regex, err := regexp.Compile(`golangci-lint\shas\sversion\sv?([\d+.]+[\d])`)
if err != nil {
return "", err
}
Expand All @@ -51,7 +51,7 @@ func getCurrentVersion() (string, error) {
if matches == nil {
return "", fmt.Errorf("no version found: %v", string(out))
}
return matches[0], err
return fmt.Sprintf("v%s", matches[1]), err
}

func isVersionValid(workflowVersion, currentVersion string) bool {
Expand Down

0 comments on commit 2b676fd

Please sign in to comment.