Go client library for accessing the GitHub API v3
Agent Success
Agent success rate when using this tile
65%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.14x
Baseline
Agent success rate without this tile
57%
Fetch organization audit log entries while enforcing custom API version headers, optional preview media types, and mixed pagination tokens from GitHub responses.
@generates
package versionedaudit
type Config struct {
// Personal access token used for authentication.
Token string
// Required API version header value.
Version string
// Toggle to include the preview Accept header for audit log endpoints.
EnablePreview bool
// Organization login to fetch audit events for.
Org string
// Optional page size to apply to paginated requests.
PageSize int
}
type Entry struct {
Action string
Actor string
Repo string
// Timestamp ISO 8601 string.
OccurredAt string
// Raw payload for assertions.
Raw map[string]any
}
type PageInfo struct {
// Next numeric page index if provided by the API; zero when absent.
NextPage int
// Forward pagination token (e.g., "after") from the response; empty when absent.
NextToken string
// Backward pagination token (e.g., "before") from the response; empty when absent.
PrevToken string
}
type Client interface {
// Fetches a single page of audit log entries, honoring the requested page number and/or pagination token.
FetchAuditPage(ctx context.Context, page int, token string) (entries []Entry, pageInfo PageInfo, err error)
// Fetches all audit log entries starting at the first page, following mixed pagination tokens until no further results remain.
FetchAll(ctx context.Context) ([]Entry, error)
}
// NewClient constructs a client using the supplied config and prepares the authenticated HTTP transport.
func NewClient(cfg Config) (Client, error)Typed GitHub REST v3 client with helpers for API versioning, preview media types, and pagination metadata.
tessl i tessl/golang-github-com-google-go-github@79.0.1docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10