Skip to content

Commit

Permalink
Merge pull request #3429 from imain/fix_notes
Browse files Browse the repository at this point in the history
NO-JIRA: Fix issue with release note tool
  • Loading branch information
openshift-merge-bot[bot] authored Feb 6, 2024
2 parents d66aae7 + 40c8f73 commit 8b92350
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ clients:

.PHONY: release
release:
go run ./hack/tools/release/notes.go --from=${FROM} --to=${TO}
go run ./hack/tools/release/notes.go --from=${FROM} --to=${TO} --token=${TOKEN}

.PHONY: app-sre-saas-template
app-sre-saas-template: hypershift
Expand Down Expand Up @@ -278,4 +278,4 @@ ci-test-e2e:
.PHONY: regenerate-pki
regenerate-pki:
REGENERATE_PKI=1 $(GO) test ./control-plane-pki-operator/...
REGENERATE_PKI=1 $(GO) test ./test/e2e/... -run TestRegeneratePKI
REGENERATE_PKI=1 $(GO) test ./test/e2e/... -run TestRegeneratePKI
10 changes: 8 additions & 2 deletions hack/tools/release/notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type commit struct {
var (
fromTag = flag.String("from", "", "The tag or commit to start from.")
toTag = flag.String("to", "", "The tag or commit to compare with.")
token = flag.String("token", "", "The token to use for github API authorization.")
)

func main() {
Expand Down Expand Up @@ -82,16 +83,21 @@ func main() {
headers := map[string]string{
"Accept": "application/vnd.github.v3+json",
}
if token != nil && *token != "" {
headers["Authorization"] = fmt.Sprintf("Bearer %s", *token)
}

// Make the API request.
resp, err := makeRequest("GET", url, headers, nil)
if err != nil {
fmt.Printf("Error making API request: %v", err)
return
os.Exit(1)
}

if resp.StatusCode != 200 {
fmt.Println(fmt.Sprintf("API returned: %v", resp.StatusCode))
fmt.Println(fmt.Sprintf("API returned: %v. Changelog incomplete!", resp.StatusCode))
fmt.Println("Consider generating an authorization token and using the --token flag.")
os.Exit(1)
}

// Parse the API response body.
Expand Down

0 comments on commit 8b92350

Please sign in to comment.