Skip to content

Commit 4a3532c

Browse files
author
Guruprasad Kulkarni
committed
Added compare Url Output
1 parent 49c10b6 commit 4a3532c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

github-release.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ func main() {
103103
Timeout: time.Duration(time.Second * time.Duration(userInput.timeout)),
104104
}
105105

106+
var compareURLs []string
107+
106108
for index, project := range userInput.projects {
107109
log.Printf("%2d : Starting Release %s for %s with Tag Version %s on branch %s with fallback branch %s and possible support branch %s", index+1, userInput.releaseName, project, userInput.tag, userInput.source, userInput.fallbackBranch, userInput.supportBranchName)
108110

@@ -112,8 +114,13 @@ func main() {
112114
log.Fatalf("Could not get the Target Branch %v", err)
113115
}
114116
log.Printf("Selected Branch %s to create tag %s", targetBranch, userInput.tag)
115-
createRelease(client, userInput, targetBranch, project, projectAPIBaseURL)
117+
compareURL := createRelease(client, userInput, targetBranch, project, projectAPIBaseURL)
118+
compareURLs = append(compareURLs, compareURL+"\n")
116119
}
120+
121+
log.Println("Release Done, Following are the release compare URLs")
122+
log.Println(compareURLs)
123+
log.Println("--")
117124
}
118125

119126
func usage() {
@@ -273,7 +280,7 @@ func addAuthAndAcceptHeader(request *http.Request) {
273280
request.Header.Add(http.CanonicalHeaderKey("Accept"), "application/vnd.github.v3+json")
274281
}
275282

276-
func createRelease(client *http.Client, userInput userInputs, targetBranch string, project string, projectAPIBaseURL string) {
283+
func createRelease(client *http.Client, userInput userInputs, targetBranch string, project string, projectAPIBaseURL string) string {
277284
previousComparePoint := targetBranch
278285
if !isEmpty(userInput.previousTag) {
279286
previousComparePoint = userInput.previousTag
@@ -313,6 +320,7 @@ func createRelease(client *http.Client, userInput userInputs, targetBranch strin
313320
}
314321

315322
log.Printf("Release Tag Created : %v", res)
323+
return releaseCompareBody
316324
}
317325

318326
func getReleaseName(userInput userInputs) string {

0 commit comments

Comments
 (0)