Fix bug only list first page when get prs from gitea (#41)
Fix bug only list first page when get prs from gitea Reviewed-on: https://gitea.com/gitea/changelog/pulls/41 Reviewed-by: techknowlogick <techknowlogick@gitea.io> Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: 6543 <6543@noreply.gitea.io>
This commit is contained in:
parent
cbd79ff6d9
commit
b8fcd83de4
@ -26,7 +26,6 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func runGenerate(cmd *cli.Context) error {
|
func runGenerate(cmd *cli.Context) error {
|
||||||
|
|
||||||
if ConfigPathFlag == "" {
|
if ConfigPathFlag == "" {
|
||||||
ConfigPathFlag = getDefaultConfigFile()
|
ConfigPathFlag = getDefaultConfigFile()
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ type Config struct {
|
|||||||
SkipRegex *regexp.Regexp `yaml:"-"`
|
SkipRegex *regexp.Regexp `yaml:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load a config from a path, defaulting to changelog.example.yml
|
// New Load a config from a path, defaulting to changelog.example.yml
|
||||||
func New(configPath string) (*Config, error) {
|
func New(configPath string) (*Config, error) {
|
||||||
var err error
|
var err error
|
||||||
var configContent []byte
|
var configContent []byte
|
||||||
|
2
go.mod
2
go.mod
@ -3,7 +3,7 @@ module code.gitea.io/changelog
|
|||||||
go 1.13
|
go 1.13
|
||||||
|
|
||||||
require (
|
require (
|
||||||
code.gitea.io/sdk/gitea v0.0.0-20200131051706-c1cfc890f875
|
code.gitea.io/sdk/gitea v0.11.1-0.20200209183134-ba7916819f3f
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
|
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
|
||||||
github.com/google/go-github v17.0.0+incompatible
|
github.com/google/go-github v17.0.0+incompatible
|
||||||
github.com/google/go-querystring v1.0.0 // indirect
|
github.com/google/go-querystring v1.0.0 // indirect
|
||||||
|
4
go.sum
4
go.sum
@ -1,5 +1,5 @@
|
|||||||
code.gitea.io/sdk/gitea v0.0.0-20200131051706-c1cfc890f875 h1:Rw4BbCwc0L4JwJko1b/k9fBuVG0NQEnGupuDZx4n+WE=
|
code.gitea.io/sdk/gitea v0.11.1-0.20200209183134-ba7916819f3f h1:Ezc1cu8bksy+eqCA0fuvkPdppqCzfJIbNQ/8ipeBV3k=
|
||||||
code.gitea.io/sdk/gitea v0.0.0-20200131051706-c1cfc890f875/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY=
|
code.gitea.io/sdk/gitea v0.11.1-0.20200209183134-ba7916819f3f/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
|
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
|
||||||
|
@ -40,7 +40,10 @@ func (ge *Gitea) Generate() (string, []PullRequest, error) {
|
|||||||
perPage := 40
|
perPage := 40
|
||||||
for {
|
for {
|
||||||
results, err := client.ListRepoPullRequests(ge.Owner, ge.Repo, gitea.ListPullRequestsOptions{
|
results, err := client.ListRepoPullRequests(ge.Owner, ge.Repo, gitea.ListPullRequestsOptions{
|
||||||
Page: p,
|
ListOptions: gitea.ListOptions{
|
||||||
|
Page: p,
|
||||||
|
PageSize: perPage,
|
||||||
|
},
|
||||||
State: "closed",
|
State: "closed",
|
||||||
Milestone: milestoneID,
|
Milestone: milestoneID,
|
||||||
})
|
})
|
||||||
@ -91,7 +94,10 @@ func (ge *Gitea) Contributors() (ContributorList, error) {
|
|||||||
perPage := 100
|
perPage := 100
|
||||||
for {
|
for {
|
||||||
results, err := client.ListRepoPullRequests(ge.Owner, ge.Repo, gitea.ListPullRequestsOptions{
|
results, err := client.ListRepoPullRequests(ge.Owner, ge.Repo, gitea.ListPullRequestsOptions{
|
||||||
Page: p,
|
ListOptions: gitea.ListOptions{
|
||||||
|
Page: p,
|
||||||
|
PageSize: perPage,
|
||||||
|
},
|
||||||
State: "closed",
|
State: "closed",
|
||||||
Milestone: milestoneID,
|
Milestone: milestoneID,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user