Skip to content

Commit

Permalink
Merge pull request #9918 from chandankumar4/fix-weekly-update-branch
Browse files Browse the repository at this point in the history
🐛 Fix wrong branch name display for weekly update script
  • Loading branch information
k8s-ci-robot authored Jan 16, 2024
2 parents 1b662d3 + bfe8d0d commit 4216a96
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 were merged into main.\n\n", commitRange, len(commits))
fmt.Printf("Changes from %v a total of %d new commits were merged into %s.\n\n", commitRange, len(commits), branch)

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

0 comments on commit 4216a96

Please sign in to comment.