Closed onnttf closed 1 month ago
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs
. You & others like you are the reason all of this works! So thank you & happy coding! 🚀
It's definitely a bit confusing, since our OpenAPI spec isn't always perfectly normalized and we have a whole bunch of models to use, and there's a lot of Kiota helpers generated as well.
Here's the approach I've found helpful (and maybe we should add this to the docs somewhere):
go-sdk
for that docs link, since Kiota includes the docs link when generating models. Note that Kiota leaves out the /en
and the apiVersion
parameter, so the docs link to search for becomes https://docs.github.com/rest/releases/releases#list-releases. This gives us https://github.com/octokit/go-sdk/blob/a379f572bf4cea19390cf5b74c09cf7ce010004c/pkg/github/repos/item_item_releases_request_builder.go#L59. Note that the item_item_releases_request_builder
belongs to the repos
package.
client, err := pkg.NewApiClient(
pkg.WithUserAgent("my-user-agent"),
pkg.WithRequestTimeout(5*time.Second),
pkg.WithBaseUrl("https://api.github.com"),
pkg.WithTokenAuthentication(os.Getenv("GITHUB_TOKEN")),
)
if err != nil {
log.Fatalf("error creating client: %v", err)
}
releases, err := client.Repos().ByOwnerId("octokit").ByRepoId("go-sdk").Releases().Get(context.Background(), nil)
if err != nil {
log.Fatalf("error getting releases: %v", err)
}
log.Printf("Releases:\n")
for _, release := range releases {
log.Printf("Tag: %v\n", *release.GetTagName())
log.Printf("Notes: %v\n", *release.GetBody())
}
I hope that helps!
Thank you very much for your help, it solved my problem.
Hello, I want to get the release list of a repo. Is there any relevant document?
Here is my code:
Here is the error message:
How should I modify it?