Documentation
¶
Index ¶
- Constants
- func SetBody(changelog Changelog) (body string, err error)
- type Changelog
- type Github
- func (g *Github) Add(files []string) error
- func (g *Github) Changelog(name string) (string, error)
- func (g *Github) Check() (errs []error)
- func (g *Github) Checkout() error
- func (g *Github) Clean() error
- func (g *Github) Clone() (string, error)
- func (g *Github) Commit(message string) error
- func (g *Github) GetDirectory() (directory string)
- func (g *Github) Init(source string, pipelineID string) error
- func (g *Github) IsPullRequest() (ID string, err error)
- func (g *Github) NewClient() *githubv4.Client
- func (g *Github) OpenPullRequest() error
- func (g *Github) Push() error
- func (g *Github) PushTag(tag string) error
- func (g *Github) SearchReleases() (releases []string, err error)
- func (g *Github) SearchTags() (tags []string, err error)
- func (g *Github) Source(workingDir string) (value string, err error)
- func (g *Github) UpdatePullRequest(ID string) error
- type PageInfo
- type PullRequest
- type RateLimit
Constants ¶
const PULLREQUESTBODY = `
## Report
{{ .Report }}
## Changelog
<details><summary>Click to expand</summary>
` + "```\n{{ .Description }}\n```" + `
</details>
## Remark
This pull request was automatically created using [Updatecli](https://www.updatecli.io).
Please report any issues with this tool [here](https://github.com/updatecli/updatecli/issues/new)
`
PULLREQUESTBODY is the pull request template used as pull request description Please note that triple backticks are concatenated with the literals, as they cannot be escaped
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Github ¶
type Github struct {
Owner string
Description string
PullRequestDescription Changelog
Repository string
Username string
Token string
URL string
Version string // **Deprecated** Version is deprecated in favor of `versionFilter.pattern`, this field will be removed in a futur version
VersionFilter version.Filter //VersionFilter provides parameters to specify version pattern and its type like regex, semver, or just latest.
Directory string
Branch string
User string
Email string
Force bool // Force is used during the git push phase to run `git push --force`.
CommitMessage commit.Commit // CommitMessage represents conventional commit metadata as type or scope, used to generate the final commit message.
// contains filtered or unexported fields
}
Github contains settings to interact with Github
func (*Github) Check ¶
Check verifies if mandatory Github parameters are provided and return false if not.
func (*Github) GetDirectory ¶
GetDirectory returns the local git repository path.
func (*Github) IsPullRequest ¶
IsPullRequest checks if a pull request already exist and is in the state 'open'.
func (*Github) OpenPullRequest ¶
OpenPullRequest creates a new pull request.
func (*Github) Push ¶
Push run `git push` then open a pull request on Github if not already created.
func (*Github) SearchReleases ¶
SearchReleases return every releases from the github api returned in reverse order of created time.
func (*Github) SearchTags ¶
SearchTags return every tags from the github api return in reverse order of commit tags.
func (*Github) UpdatePullRequest ¶
UpdatePullRequest updates an existing pull request.