Skip to content

Commit

Permalink
Fix wrong branch name display for weekly update script
Browse files Browse the repository at this point in the history
Signed-off-by: chandankumar4 <[email protected]>
  • Loading branch information
chandankumar4 committed Dec 22, 2023
1 parent 7a1830a commit a4bd4f5
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion hack/tools/release/weekly/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,24 @@ func run() int {
merges[key] = append(merges[key], formatMerge(body, prNumber))
}

// fetch the current branch
out, err = exec.Command("git", "rev-parse", "--abbrev-ref", "HEAD").CombinedOutput()
if err != nil {
fmt.Println("Error")
fmt.Println(err)
fmt.Println(string(out))
return 1
}

branch := strings.TrimSpace(string(out))
if branch == "" {
fmt.Println("Error: failed to get current branch!!!")
return 1
}

// TODO Turn this into a link (requires knowing the project name + organization)
fmt.Println("Weekly update :rotating_light:")
fmt.Printf("Changes from %v a total of %d new commits where merged into main.\n\n", commitRange, len(commits))
fmt.Printf("Changes from %v a total of %d new commits where merged into %s.\n\n", commitRange, len(commits), branch)

for _, key := range outputOrder {
mergeslice := merges[key]
Expand Down

0 comments on commit a4bd4f5

Please sign in to comment.