Respect --token argument on github too
This commit is contained in:
parent
07c0fc1414
commit
ae9006322a
|
@ -26,11 +26,17 @@ type GitHub struct {
|
|||
|
||||
// Generate returns a GitHub changelog
|
||||
func (gh *GitHub) Generate() (string, []Entry, error) {
|
||||
tagURL := fmt.Sprintf("## [%s](https://github.com/%s/releases/tag/%s) - %s", gh.Milestone, gh.Repo, gh.GitTag, time.Now().Format("2006-01-02"))
|
||||
|
||||
client := github.NewClient(httpClient())
|
||||
ctx := context.Background()
|
||||
|
||||
tagURL := fmt.Sprintf("## [%s](https://github.com/%s/releases/tag/%s) - %s", gh.Milestone, gh.Repo, gh.GitTag, time.Now().Format("2006-01-02"))
|
||||
var client *github.Client
|
||||
|
||||
if gh.Token != "" {
|
||||
client = github.NewTokenClient(ctx, gh.Token)
|
||||
} else {
|
||||
client = github.NewClient(httpClient())
|
||||
}
|
||||
|
||||
prs := make([]Entry, 0)
|
||||
|
||||
state := "merged"
|
||||
|
|
Loading…
Reference in New Issue