Skip to content

Commit

Permalink
fix(GoogleCloudPlatform#189): Change the way to return repo name as p…
Browse files Browse the repository at this point in the history
…revious logic doesn't work
  • Loading branch information
VuKrampHub authored and khhini committed Oct 12, 2024
1 parent 9910872 commit 88f1691
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions githubissues/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,10 @@ func (g *githubissuesNotifier) SendNotification(ctx context.Context, build *cbpb
}

func GetGithubRepo(configGithubRepo string, build *cbpb.Build) string {
if build.Substitutions != nil {
if repo, ok := build.Substitutions["REPO_FULL_NAME"]; ok {
// return repo full name if it's available
// e.g. "GoogleCloudPlatform/cloud-build-notifiers"
return repo
}
if build.Substitutions != nil && build.Substitutions["REPO_FULL_NAME"] != "" {
// return repo full name if it's available
// e.g. "GoogleCloudPlatform/cloud-build-notifiers"
return build.Substitutions["REPO_FULL_NAME"]
}
return configGithubRepo
}

0 comments on commit 88f1691

Please sign in to comment.