Merge branch 'gitea-sdk' of https://gitea.com/jolheiser/changelog into gitea-sdk

This commit is contained in:
jolheiser 2020-01-23 10:54:59 -06:00
commit 722757a56d
No known key found for this signature in database
GPG Key ID: 83E486E71AFEB820
7 changed files with 28 additions and 10 deletions

View File

@ -1,3 +1,7 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// +build ignore
package main
@ -11,7 +15,11 @@ import (
const (
exampleFile = "changelog.example.yml"
writeFile = "config/config_default.go"
tmpl = `package config
tmpl = `// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package config
func init() {
defaultConfig = []byte(` + "`" + `%s` + "`" + `)

View File

@ -15,10 +15,9 @@ import (
)
var Contributors = &cli.Command{
Name: "contributors",
Usage: "generate contributors list",
Description: "generate contributors list",
Action: runContributors,
Name: "contributors",
Usage: "Generates a contributors list",
Action: runContributors,
}
func runContributors(cmd *cli.Context) error {

View File

@ -14,10 +14,9 @@ import (
)
var Generate = &cli.Command{
Name: "generate",
Usage: "generate changelog",
Description: "generate changelog",
Action: runGenerate,
Name: "generate",
Usage: "Generates a changelog",
Action: runGenerate,
}
func runGenerate(cmd *cli.Context) error {

View File

@ -1,3 +1,7 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package config
func init() {

View File

@ -31,12 +31,12 @@ func (ge *Gitea) Generate() (string, []PullRequest, error) {
return "", nil, err
}
tagURL := fmt.Sprintf("## [%s](%s/%s/%s/pulls?q=&type=all&state=closed&milestone=%d) - %s", ge.Milestone, ge.BaseURL, ge.Owner, ge.Repo, milestoneID, time.Now().Format("2006-01-02"))
p := 1
// https://github.com/go-gitea/gitea/blob/d92781bf941972761177ac9e07441f8893758fd3/models/repo.go#L63
// https://github.com/go-gitea/gitea/blob/e3c3b33ea7a5a223e22688c3f0eb2d3dab9f991c/models/pull_list.go#L104
// FIXME Gitea has this hard-coded at 40
perPage := 40
for {
results, err := client.ListRepoPullRequests(ge.Owner, ge.Repo, gitea.ListPullRequestsOptions{

View File

@ -1,3 +1,7 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package service
import "testing"

View File

@ -1,3 +1,7 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package service
import (