github

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCheckRun

func CreateCheckRun(
	ctx context.Context,
	client *http.Client,
	token string,
	repo *common.Repository,
	sha,
	status,
	name,
	title,
	summary string,
) (string, error)

func DeleteRef

func DeleteRef(ctx context.Context, client *http.Client, token, refNodeID string) error

func GetConfig

func GetConfig(
	ctx context.Context,
	client *http.Client,
	token string,
	repository *common.Repository,
	sha string,
) ([]byte, error)

func GetLatestBaseCommitSha

func GetLatestBaseCommitSha(ctx context.Context, client *http.Client, token string, repo *common.Repository) (string, error)

func GetPullRequestsThatAreOpenAndHaveOneOfTheseLabels

func GetPullRequestsThatAreOpenAndHaveOneOfTheseLabels(
	ctx context.Context,
	client *http.Client,
	token string,
	repository *common.Repository,
	labels []string,
) ([]common.PullRequest, error)

func MergePullRequest

func MergePullRequest(
	ctx context.Context,
	client *http.Client,
	token,
	pullRequestID,
	expectedHeadOid,
	mergeStrategy string,
) error

func UpdateCheckRun

func UpdateCheckRun(
	ctx context.Context,
	client *http.Client,
	token string,
	repo *common.Repository,
	checkRunID,
	status,
	name,
	title,
	summary string,
) (string, error)

func UpdatePullRequest

func UpdatePullRequest(
	ctx context.Context,
	client *http.Client,
	token string,
	pullRequestID,
	expectedHeadSha string,
) error

Types

type AccessToken

type AccessToken struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expires_at"`
}

func GetAccessToken

func GetAccessToken(
	ctx context.Context,
	client *http.Client,
	appID int64,
	privateKey []byte,
	repository *common.Repository,
	installationID int64,
) (*AccessToken, error)

type PullRequestDetails

type PullRequestDetails struct {
	AheadBy        int
	ApprovedBy     []string
	Author         string
	BaseRefName    string
	CheckStates    map[string]string
	HasConflicts   bool
	HeadRefID      string
	HeadRefName    string
	ID             string
	IsMergeable    bool
	Labels         []string
	LastCommitSha  string
	LastCommitTime time.Time
	State          string
	Title          string
}

func GetPullRequestDetails

func GetPullRequestDetails(
	ctx context.Context,
	client *http.Client,
	token string,
	repo *common.Repository,
	number int64,
) (*PullRequestDetails, error)

type ResponseError

type ResponseError struct {
	Message            string
	ActualStatusCode   int
	ExpectedStatusCode int
	Body               string
	NextError          error
}

func (*ResponseError) Error

func (e *ResponseError) Error() string

func (*ResponseError) MarshalZerologObject

func (e *ResponseError) MarshalZerologObject(ev *zerolog.Event)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL