Documentation
¶
Index ¶
- Constants
- func AppInstallationURL(properties core.IntegrationPropertyStorageReader, installationID string) (string, error)
- func AppURL(properties core.IntegrationPropertyStorageReader, appSlug string) (string, error)
- func EnsureRepoInMetadata(ctx core.MetadataWriter, integration core.IntegrationContext, ...) error
- func ExtractAction(data map[string]any) (string, bool)
- func FindSecret(ctx core.IntegrationContext, secretName string) (string, error)
- func IsExpression(s string) bool
- func IsNotFoundError(err error) bool
- func SanitizeAssignees(assignees []string) []string
- func VerifySignature(ctx core.WebhookRequestContext) (int, error)
- func WhitelistedAction(data map[string]any, allowed []string) bool
- func WithWebhookLogger(ctx core.WebhookRequestContext, triggerName string) core.WebhookRequestContext
- type Client
- func (c *Client) AddIssueAssignees(ctx context.Context, repository string, issueNumber int, assignees []string) (*github.Issue, *github.Response, error)
- func (c *Client) AddLabelsToIssue(ctx context.Context, repository string, issueNumber int, labels []string) ([]*github.Label, *github.Response, error)
- func (c *Client) AddPullRequestReviewers(ctx context.Context, repository string, pullNumber int, ...) (*github.PullRequest, *github.Response, error)
- func (c *Client) CancelWorkflowRun(repository string, workflowRunID int64) (*github.Response, error)
- func (c *Client) CreateDeployment(ctx context.Context, repository string, request *github.DeploymentRequest) (*github.Deployment, *github.Response, error)
- func (c *Client) CreateDeploymentStatus(ctx context.Context, repository string, deploymentID int64, ...) (*github.DeploymentStatus, *github.Response, error)
- func (c *Client) CreateHook(ctx context.Context, repository string, hook *github.Hook) (*github.Hook, *github.Response, error)
- func (c *Client) CreateIssue(ctx context.Context, repository string, issue *github.IssueRequest) (*github.Issue, *github.Response, error)
- func (c *Client) CreateIssueComment(ctx context.Context, repository string, issueNumber int, ...) (*github.IssueComment, *github.Response, error)
- func (c *Client) CreateIssueReaction(ctx context.Context, repository string, commentID int64, content string) (*github.Reaction, *github.Response, error)
- func (c *Client) CreatePullRequest(ctx context.Context, repository string, pullRequest *github.NewPullRequest) (*github.PullRequest, *github.Response, error)
- func (c *Client) CreatePullRequestReview(ctx context.Context, repository string, pullNumber int, ...) (*github.PullRequestReview, *github.Response, error)
- func (c *Client) CreateRelease(ctx context.Context, repository string, release *github.RepositoryRelease) (*github.RepositoryRelease, *github.Response, error)
- func (c *Client) CreateReviewCommentReaction(ctx context.Context, repository string, commentID int64, content string) (*github.Reaction, *github.Response, error)
- func (c *Client) CreateStatus(ctx context.Context, repository string, sha string, status github.RepoStatus) (*github.RepoStatus, *github.Response, error)
- func (c *Client) CreateWorkflowDispatchEvent(ctx context.Context, repository string, workflowFile string, ...) (*github.WorkflowDispatchRunDetails, *github.Response, error)
- func (c *Client) DeleteHook(ctx context.Context, repository string, hookID int64) (*github.Response, error)
- func (c *Client) DeleteRef(ctx context.Context, repository string, ref string) (*github.Response, error)
- func (c *Client) DeleteRelease(ctx context.Context, repository string, id int64) (*github.Response, error)
- func (c *Client) EditIssue(ctx context.Context, repository string, issueNumber int, ...) (*github.Issue, *github.Response, error)
- func (c *Client) EditIssueComment(ctx context.Context, repository string, commentID int64, ...) (*github.IssueComment, *github.Response, error)
- func (c *Client) EditRelease(ctx context.Context, repository string, id int64, ...) (*github.RepositoryRelease, *github.Response, error)
- func (c *Client) FindRepository(repository string) (*github.Repository, error)
- func (c *Client) GenerateReleaseNotes(ctx context.Context, repository string, options *github.GenerateNotesOptions) (*github.RepositoryReleaseNotes, *github.Response, error)
- func (c *Client) GetCombinedStatus(ctx context.Context, repository string, ref string, opts *github.ListOptions) (*github.CombinedStatus, *github.Response, error)
- func (c *Client) GetIssue(ctx context.Context, repository string, issueNumber int) (*github.Issue, *github.Response, error)
- func (c *Client) GetLatestRelease(ctx context.Context, repository string) (*github.RepositoryRelease, *github.Response, error)
- func (c *Client) GetOrganizationUsageReport() (*github.UsageReport, *github.Response, error)
- func (c *Client) GetPullRequest(ctx context.Context, repository string, pullNumber int) (*github.PullRequest, *github.Response, error)
- func (c *Client) GetRef(repository string, ref string) (*github.Reference, *github.Response, error)
- func (c *Client) GetRelease(ctx context.Context, repository string, id int64) (*github.RepositoryRelease, *github.Response, error)
- func (c *Client) GetReleaseByTag(ctx context.Context, repository string, tag string) (*github.RepositoryRelease, *github.Response, error)
- func (c *Client) GetRepositoryPermissionLevel(ctx context.Context, repository string, username string) (*github.RepositoryPermissionLevel, *github.Response, error)
- func (c *Client) GetWorkflowRun(repository string, workflowRunID int64) (*github.WorkflowRun, *github.Response, error)
- func (c *Client) ListBranches(ctx context.Context, repository string, opts *github.BranchListOptions) ([]*github.Branch, *github.Response, error)
- func (c *Client) ListCheckRunsForRef(ctx context.Context, repository string, ref string, ...) (*github.ListCheckRunsResults, *github.Response, error)
- func (c *Client) ListLabelsForIssue(ctx context.Context, repository string, issueNumber int) ([]*github.Label, *github.Response, error)
- func (c *Client) ListReleases(ctx context.Context, repository string, options *github.ListOptions) ([]*github.RepositoryRelease, *github.Response, error)
- func (c *Client) ListRepositories() ([]*github.Repository, error)
- func (c *Client) MarkPullRequestReadyForReview(ctx context.Context, pullRequestID string) error
- func (c *Client) MergePullRequest(ctx context.Context, repository string, pullNumber int, commitMessage string, ...) (*github.PullRequestMergeResult, *github.Response, error)
- func (c *Client) RemoveIssueAssignees(ctx context.Context, repository string, issueNumber int, assignees []string) (*github.Issue, *github.Response, error)
- func (c *Client) RemoveLabelForIssue(ctx context.Context, repository string, issueNumber int, label string) (*github.Response, error)
- type GitHubAppMetadata
- type Metadata
- type NodeMetadata
- type Repository
- type WebhookConfiguration
Constants ¶
const AuthMethodApp = "app"
const AuthMethodPAT = "pat"
const GitHubAppClientSecret = "clientSecret"
const GitHubAppPEM = "pem"
* These are the legacy secrets
const GitHubAppWebhookSecret = "webhookSecret"
const OwnerTypeOrganization = "Organization"
const OwnerTypeUser = "User Account"
const PropertyAppClientID = "appClientID"
const PropertyAppID = "appID"
* When connecting to the owner with a GitHub App, * these are the properties we get back from GitHub, * through the app creation / installation flow.
const PropertyAppInstallationID = "appInstallationID"
const PropertyAppInstallationURL = "appInstallationURL"
const PropertyAppSlug = "appSlug"
const PropertyAppState = "appState"
const PropertyAppURL = "appURL"
const PropertyAuthMethod = "authMethod"
* Two authentication methods are supported: * - Personal Access Token (PAT) * - GitHub App
const PropertyOwner = "owner"
const PropertyOwnerType = "ownerType"
* An integration can be connected to: * - A user account * - An organization
const SecretAppClientSecret = "appClientSecret"
const SecretAppPEM = "appPEM"
const SecretAppWebhookSecret = "appWebhookSecret"
const SecretPAT = "pat"
* Secrets for the integration: * - Personal Access Token (PAT) * - GitHub App private key (App) * - GitHub App client secret (App) * - GitHub App webhook secret (App)
Variables ¶
This section is empty.
Functions ¶
func AppInstallationURL ¶ added in v0.20.0
func AppInstallationURL(properties core.IntegrationPropertyStorageReader, installationID string) (string, error)
func AppURL ¶ added in v0.20.0
func AppURL(properties core.IntegrationPropertyStorageReader, appSlug string) (string, error)
func EnsureRepoInMetadata ¶
func EnsureRepoInMetadata(ctx core.MetadataWriter, integration core.IntegrationContext, httpCtx core.HTTPContext, configuration any) error
func FindSecret ¶
func FindSecret(ctx core.IntegrationContext, secretName string) (string, error)
func IsExpression ¶ added in v0.20.0
IsExpression reports whether the given string contains an expression placeholder (e.g. `{{ ... }}`). Useful in Setup paths to skip strict validation of values that will only be known at execution time.
func IsNotFoundError ¶ added in v0.20.0
func SanitizeAssignees ¶
func VerifySignature ¶
func VerifySignature(ctx core.WebhookRequestContext) (int, error)
func WithWebhookLogger ¶
func WithWebhookLogger(ctx core.WebhookRequestContext, triggerName string) core.WebhookRequestContext
Types ¶
type Client ¶ added in v0.20.0
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(ctx core.IntegrationContext, httpCtx core.HTTPContext) (*Client, error)
func (*Client) AddIssueAssignees ¶ added in v0.20.0
func (*Client) AddLabelsToIssue ¶ added in v0.20.0
func (*Client) AddPullRequestReviewers ¶ added in v0.26.0
func (*Client) CancelWorkflowRun ¶ added in v0.20.0
func (*Client) CreateDeployment ¶ added in v0.21.0
func (*Client) CreateDeploymentStatus ¶ added in v0.21.0
func (*Client) CreateHook ¶ added in v0.20.0
func (*Client) CreateIssue ¶ added in v0.20.0
func (*Client) CreateIssueComment ¶ added in v0.20.0
func (*Client) CreateIssueReaction ¶ added in v0.20.0
func (*Client) CreatePullRequest ¶ added in v0.20.0
func (*Client) CreatePullRequestReview ¶ added in v0.20.0
func (*Client) CreateRelease ¶ added in v0.20.0
func (*Client) CreateReviewCommentReaction ¶ added in v0.20.0
func (*Client) CreateStatus ¶ added in v0.20.0
func (*Client) CreateWorkflowDispatchEvent ¶ added in v0.20.0
func (*Client) DeleteHook ¶ added in v0.20.0
func (*Client) DeleteRelease ¶ added in v0.20.0
func (*Client) EditIssueComment ¶ added in v0.26.0
func (*Client) EditRelease ¶ added in v0.20.0
func (*Client) FindRepository ¶ added in v0.20.0
func (c *Client) FindRepository(repository string) (*github.Repository, error)
func (*Client) GenerateReleaseNotes ¶ added in v0.20.0
func (*Client) GetCombinedStatus ¶ added in v0.25.0
func (*Client) GetLatestRelease ¶ added in v0.20.0
func (*Client) GetOrganizationUsageReport ¶ added in v0.20.0
func (*Client) GetPullRequest ¶ added in v0.29.0
func (*Client) GetRelease ¶ added in v0.20.0
func (*Client) GetReleaseByTag ¶ added in v0.20.0
func (*Client) GetRepositoryPermissionLevel ¶ added in v0.20.0
func (*Client) GetWorkflowRun ¶ added in v0.20.0
func (*Client) ListBranches ¶ added in v0.20.0
func (*Client) ListCheckRunsForRef ¶ added in v0.25.0
func (*Client) ListLabelsForIssue ¶ added in v0.20.0
func (*Client) ListReleases ¶ added in v0.20.0
func (*Client) ListRepositories ¶ added in v0.20.0
func (c *Client) ListRepositories() ([]*github.Repository, error)
func (*Client) MarkPullRequestReadyForReview ¶ added in v0.29.0
MarkPullRequestReadyForReview takes a pull request out of the draft state. GitHub exposes this only through the GraphQL API, so it is the one pull request operation that cannot delegate to the REST client. It takes the pull request node ID (github.PullRequest.NodeID), not the pull request number.
func (*Client) MergePullRequest ¶ added in v0.25.0
func (*Client) RemoveIssueAssignees ¶ added in v0.20.0
type GitHubAppMetadata ¶
type Metadata ¶
type Metadata struct {
InstallationID string `mapstructure:"installationId" json:"installationId"`
State string `mapstructure:"state" json:"state"`
Owner string `mapstructure:"owner" json:"owner"`
Repositories []Repository `mapstructure:"repositories" json:"repositories"`
GitHubApp GitHubAppMetadata `mapstructure:"githubApp" json:"githubApp"`
}
type NodeMetadata ¶
type NodeMetadata struct {
Repository *Repository `json:"repository"`
}