Skip to content

Commit

Permalink
feat: not enforce .git suffix and enfore match group length
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijie-yang committed Sep 23, 2024
1 parent 6e11b0b commit a8a85a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/cli-client/internals/trigger/build_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func InferBuildMetadata() BuildMetadata {
logger.Debugf("Remote URL: %s", remoteURL)

// use regex to match the repo location
regex := regexp.MustCompile("github.com[:/](canonical/.*).git")
regex := regexp.MustCompile("github.com[:/](canonical/.*)")
matches := regex.FindStringSubmatch(remoteURL)
if len(matches) < 2 {
fmt.Fprintf(os.Stderr, "oci-factory must be called in a git local repository under organization [canonical]\n")
if len(matches) != 2 {
fmt.Fprintf(os.Stderr, "oci-factory must be called in a git local repository belongs to the organization [canonical]\n")
os.Exit(1)
}
source := matches[1]
Expand Down

0 comments on commit a8a85a5

Please sign in to comment.