Documentation ¶
Index ¶
- type GitHubRichClient
- func (ghrc *GitHubRichClient) CommentHelpToPullRequest(number int) (err error)
- func (ghrc *GitHubRichClient) CreateRelease(tagName string, releasePrefix string, releaseBranch string, body string) (createdRelease *github.RepositoryRelease, err error)
- func (ghrc *GitHubRichClient) GetIssueComments(issueNumber int) (issueComments []*github.IssueComment, err error)
- func (ghrc *GitHubRichClient) GetLatestReleaseVersion() (latestRelease *github.RepositoryRelease, err error)
- func (ghrc *GitHubRichClient) GetPrInfos(prNumber int, mergeCommitSha string) (prInfos *github.PullRequest, err error)
- func (ghrc *GitHubRichClient) PublishRelease(tagName string, releasePrefix string, releaseBranch string, body string, ...) (releaseAssets []*github.ReleaseAsset, err error)
- func (ghrc *GitHubRichClient) SearchIssuesForOverrides(prNumber int) (nextVersion *string, patchLevel *semver.PatchLevel, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHubRichClient ¶
func NewGitHubClient ¶
func NewGitHubClient(serverURL *string, repoURL *string, token *string) (githubRichClient *GitHubRichClient, err error)
NewGitHubClient creates a new GitHub client Needs the ConnectCredentials
func (*GitHubRichClient) CommentHelpToPullRequest ¶
func (ghrc *GitHubRichClient) CommentHelpToPullRequest(number int) (err error)
func (*GitHubRichClient) CreateRelease ¶
func (ghrc *GitHubRichClient) CreateRelease(tagName string, releasePrefix string, releaseBranch string, body string) (createdRelease *github.RepositoryRelease, err error)
CreateRelease creates a new release in the GitHub repository.
Parameters: - tagName: the name of the tag for the release. - releasePrefix: the prefix for the release name. - releaseBranch: the branch for the release (default: git default). - body: the body of the release (markdown string or file).
Returns: - createdRelease: the created repository release. - err: an error if there was a problem creating the release.
func (*GitHubRichClient) GetIssueComments ¶
func (ghrc *GitHubRichClient) GetIssueComments(issueNumber int) (issueComments []*github.IssueComment, err error)
func (*GitHubRichClient) GetLatestReleaseVersion ¶
func (ghrc *GitHubRichClient) GetLatestReleaseVersion() (latestRelease *github.RepositoryRelease, err error)
GetLatestReleaseVersion retrieves the latest release version from the GitHub repository.
It returns the latest non-draft release and any error encountered during the process. The latest release is mapped to its tag name in the releaseMap. The function queries the releases in the repository in pages of 100, starting from page 1. For each release, it checks if it is not a draft and adds it to the releaseMap. The function continues querying releases until there are no more pages. Finally, it calls the findLatestRelease function to find the latest release based on the releaseMap.
Parameters: - ghrc: a pointer to the GitHubRichClient struct.
Returns: - latestRelease: a pointer to the latest non-draft release. - err: an error if any occurred during the process.
func (*GitHubRichClient) GetPrInfos ¶
func (ghrc *GitHubRichClient) GetPrInfos(prNumber int, mergeCommitSha string) (prInfos *github.PullRequest, err error)
GetPrInfos need the PullRequest-Number
func (*GitHubRichClient) PublishRelease ¶
func (ghrc *GitHubRichClient) PublishRelease( tagName string, releasePrefix string, releaseBranch string, body string, releaseID int64, uploadArtifacts []tools.UploadAsset) (releaseAssets []*github.ReleaseAsset, err error)
PublishRelease publishes a GitHub release.
Parameters: - tagName: the name of the tag for the release. - releasePrefix: the prefix for the release name. - releaseBranch: the branch for the release. - body: the body of the release. - releaseID: the ID of the existing release (0 if not found). - uploadArtifacts: the list of artifacts to upload.
Returns: - releaseAssets: the list of release assets. - err: an error if any occurred.
func (*GitHubRichClient) SearchIssuesForOverrides ¶
func (ghrc *GitHubRichClient) SearchIssuesForOverrides(prNumber int) (nextVersion *string, patchLevel *semver.PatchLevel, err error)