github

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package github provides a client for interacting with the GitHub Actions API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchJobs

func FetchJobs(ctx context.Context, client *Client, owner, repo string, workflowID int64, store *storage.Store, runIDs []int64) error

FetchJobs fetches jobs for the given run IDs and stores them.

func FetchRuns

func FetchRuns(ctx context.Context, client *Client, owner, repo string, workflowID int64, store *storage.Store, opts *RunOptions) ([]int64, error)

FetchRuns fetches workflow runs from GitHub and stores them locally. It skips runs that already exist in storage. Returns the IDs of newly fetched runs.

func FetchStoredRunJobs

func FetchStoredRunJobs(ctx context.Context, client *Client, owner, repo string, workflowID int64, store *storage.Store) error

FetchStoredRunJobs fetches jobs for all stored runs that don't have jobs yet.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the GitHub API client with rate limit logging.

func NewClient

func NewClient(token string) *Client

NewClient creates a new GitHub client with the given token. If token is empty, requests will be unauthenticated (lower rate limits).

func (*Client) Actions

func (c *Client) Actions() *github.ActionsService

Actions returns the Actions service for accessing GitHub Actions API.

func (*Client) RateLimits

func (c *Client) RateLimits(ctx context.Context) (*github.RateLimits, error)

RateLimits returns current rate limit status.

type RunOptions

type RunOptions struct {
	Created string // Date filter in format '2021-10-12' or '2021-10-29T22:40:19Z'
}

RunOptions configures the FetchRuns operation.

Jump to

Keyboard shortcuts

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