Documentation ¶
Index ¶
- Variables
- func CheckSignature(installationID int64) error
- func ClearRunsCache(owner, repo string)
- func DivideScope(scope string) (string, string)
- func ExistGitHubRepository(scope string, accessToken string) error
- func ExistGitHubRunner(ctx context.Context, client *github.Client, owner, repo, runnerName string) (*github.Runner, error)
- func ExistGitHubRunnerWithRunner(runners []*github.Runner, runnerName string) (*github.Runner, error)
- func ExistRunnerReleases(runnerVersion string) error
- func ExtractRunsOnLabels(in []byte) ([]string, error)
- func GenerateGitHubAppsToken(ctx context.Context, clientApps *github.Client, installationID int64, ...) (string, *time.Time, error)
- func GetLatestRunnerVersion(ctx context.Context, scope, token string) (string, error)
- func GetRateLimitLimit() map[string]int
- func GetRateLimitRemain() map[string]int
- func GetRunnerRegistrationToken(ctx context.Context, installationID int64, scope string) (string, error)
- func InitializeCache(appID int64, appPEM []byte) error
- func IsInstalledGitHubApp(ctx context.Context, inputScope string) (int64, error)
- func ListRunners(ctx context.Context, client *github.Client, owner, repo string) ([]*github.Runner, error)
- func ListRuns(owner, repo string) ([]*github.WorkflowRun, error)
- func NewClient(token string) (*github.Client, error)
- func NewClientGitHubApps() (*github.Client, error)
- func NewClientInstallation(installationID int64) (*github.Client, error)
- type Scope
Constants ¶
This section is empty.
Variables ¶
var ( GHlistInstallations = listInstallations GHlistAppsInstalledRepo = listAppsInstalledRepo )
function pointers (for testing)
var ActiveTargets = sync.Map{}
ActiveTargets stores targets by recently received webhook
var ( // ErrNotFound is error for not found ErrNotFound = fmt.Errorf("not found") )
var PendingRuns = sync.Map{}
PendingRuns stores queued / pending workflow runs
Functions ¶
func CheckSignature ¶
CheckSignature check trust installation id from event.
func ClearRunsCache ¶ added in v1.15.1
func ClearRunsCache(owner, repo string)
ClearRunsCache clear github workflow run caches
func DivideScope ¶ added in v1.6.1
DivideScope divide scope to owner and repo
func ExistGitHubRepository ¶
ExistGitHubRepository check exist of GitHub repository
func ExistGitHubRunner ¶ added in v1.9.2
func ExistGitHubRunner(ctx context.Context, client *github.Client, owner, repo, runnerName string) (*github.Runner, error)
ExistGitHubRunner check exist registered of GitHub runner
func ExistGitHubRunnerWithRunner ¶ added in v1.10.7
func ExistGitHubRunnerWithRunner(runners []*github.Runner, runnerName string) (*github.Runner, error)
ExistGitHubRunnerWithRunner check exist registered of GitHub runner from a list of runner
func ExistRunnerReleases ¶ added in v1.10.10
ExistRunnerReleases check exist of runner file
func ExtractRunsOnLabels ¶ added in v1.12.0
ExtractRunsOnLabels extract labels from github.WorkflowJobEvent
func GenerateGitHubAppsToken ¶ added in v1.7.0
func GenerateGitHubAppsToken(ctx context.Context, clientApps *github.Client, installationID int64, scope string) (string, *time.Time, error)
GenerateGitHubAppsToken generate token of GitHub Apps using private key clientApps needs to response of `NewClientGitHubApps()`
func GetLatestRunnerVersion ¶ added in v1.13.0
GetLatestRunnerVersion get a latest version of actions/runner
func GetRateLimitLimit ¶ added in v1.10.5
GetRateLimitLimit get a list of rate limit key: scope, value: remain
func GetRateLimitRemain ¶ added in v1.10.5
GetRateLimitRemain get a list of rate limit remaining key: scope, value: remain
func GetRunnerRegistrationToken ¶ added in v1.10.6
func GetRunnerRegistrationToken(ctx context.Context, installationID int64, scope string) (string, error)
GetRunnerRegistrationToken get token for register runner clientInstallation needs to response of `NewClientInstallation()`
func InitializeCache ¶ added in v1.10.6
InitializeCache create a cache
func IsInstalledGitHubApp ¶ added in v1.7.0
IsInstalledGitHubApp check installed GitHub Apps in gheDomain + inputScope clientApps needs to response of `NewClientGitHubApps()`
func ListRunners ¶ added in v1.6.1
func ListRunners(ctx context.Context, client *github.Client, owner, repo string) ([]*github.Runner, error)
ListRunners get runners that registered repository or org
func ListRuns ¶ added in v1.15.1
func ListRuns(owner, repo string) ([]*github.WorkflowRun, error)
ListRuns get workflow runs that registered repository
func NewClientGitHubApps ¶ added in v1.9.7
NewClientGitHubApps create a client of GitHub using Private Key from GitHub Apps header is "Authorization: Bearer YOUR_JWT" docs: https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app
func NewClientInstallation ¶ added in v1.9.7
NewClientInstallation create a client of GitHub using installation ID from GitHub Apps header is "Authorization: token YOUR_INSTALLATION_ACCESS_TOKEN" docs: https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-an-installation