mirror of https://gitlab.com/gitlab-org/cli.git
26 lines
641 B
Go
26 lines
641 B
Go
package api
|
|
|
|
import "github.com/xanzy/go-gitlab"
|
|
|
|
var GenerateChangelog = func(client *gitlab.Client, projectID interface{}, options *gitlab.GenerateChangelogDataOptions) (*gitlab.ChangelogData, error) {
|
|
if client == nil {
|
|
client = apiClient.Lab()
|
|
}
|
|
|
|
changelog, _, err := client.Repositories.GenerateChangelogData(projectID, *options)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return changelog, nil
|
|
}
|
|
|
|
var AddChangelog = func(client *gitlab.Client, projectID interface{}, opt *gitlab.AddChangelogOptions) error {
|
|
if client == nil {
|
|
client = apiClient.Lab()
|
|
}
|
|
|
|
_, err := client.Repositories.AddChangelog(projectID, opt)
|
|
return err
|
|
}
|