github

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package github wraps the GitHub REST API v3 as a wick connector. One instance = one GitHub account or organisation (token + optional custom base URL for GitHub Enterprise). Operations cover the most common LLM-driven workflows: listing repos/issues/PRs, reading file contents, creating issues, and posting comments.

File layout:

  • connector.go — Meta, Configs, Input structs, Operations, thin handlers
  • service.go — URL construction, input validation, response shaping
  • repo.go — outbound HTTP via http.NewRequestWithContext

Index

Constants

View Source
const Key = "github"

Variables

This section is empty.

Functions

func HealthCheck added in v0.18.1

func HealthCheck(c *connector.Ctx) ([]connector.OpHealth, error)

HealthCheck verifies the configured token by calling GET /user. It reports a single OpHealth entry ("auth"): OK on a 2xx response, or OK=false with GitHub's error message otherwise. Surfaced in the admin UI's "Check Permissions" button when wired into the connector module.

func Meta

func Meta() connector.Meta

Meta returns the static metadata block for this connector.

func Operations

func Operations() []connector.Operation

Operations returns the LLM-callable actions for this connector.

Types

type AddCommentInput

type AddCommentInput struct {
	Owner  string `wick:"required;desc=Repository owner."`
	Repo   string `wick:"required;desc=Repository name."`
	Number int    `wick:"required;desc=Issue or PR number."`
	Body   string `wick:"textarea;required;desc=Comment body (Markdown supported)."`
}

AddCommentInput posts a comment on an issue or PR.

type Configs

type Configs struct {
	BaseURL string `` /* 128-byte string literal not displayed */
	Token   string `` /* 143-byte string literal not displayed */
}

Configs is the per-instance credential set.

type CreateForkInput added in v0.18.1

type CreateForkInput struct {
	Owner        string `wick:"required;desc=Repository owner to fork from."`
	Repo         string `wick:"required;desc=Repository name to fork."`
	Organization string `wick:"desc=Org to fork into. Default: the authenticated user's account."`
	Name         string `wick:"desc=Name for the new fork. Default: same as source repo."`
}

CreateForkInput forks a repository.

type CreateIssueInput

type CreateIssueInput struct {
	Owner  string `wick:"required;desc=Repository owner."`
	Repo   string `wick:"required;desc=Repository name."`
	Title  string `wick:"required;desc=Issue title."`
	Body   string `wick:"textarea;desc=Issue body (Markdown supported)."`
	Labels string `wick:"desc=Comma-separated label names. Example: bug,help wanted"`
}

CreateIssueInput creates a new issue.

type CreateOrUpdateFileInput added in v0.18.1

type CreateOrUpdateFileInput struct {
	Owner   string `wick:"required;desc=Repository owner."`
	Repo    string `wick:"required;desc=Repository name."`
	Path    string `wick:"required;desc=file path in repo. Example: src/main.go"`
	Content string `wick:"textarea;required;desc=new file content, PLAINTEXT — will be base64-encoded."`
	Message string `wick:"required;desc=commit message."`
	Branch  string `wick:"desc=target branch; default repo default."`
	Sha     string `wick:"desc=blob sha of the file being replaced; required by GitHub when updating an existing file."`
}

CreateOrUpdateFileInput creates or updates a single file via the contents API.

type CreatePRInput added in v0.18.1

type CreatePRInput struct {
	Owner string `wick:"required;desc=Repository owner."`
	Repo  string `wick:"required;desc=Repository name."`
	Title string `wick:"required;desc=Pull request title."`
	Head  string `wick:"required;desc=source branch (e.g. feature-x or owner:branch for cross-fork)."`
	Base  string `wick:"required;desc=target branch e.g. main/master."`
	Body  string `wick:"textarea;desc=Pull request body (Markdown supported)."`
	Draft bool   `wick:"desc=Open as a draft PR. Default: false."`
}

CreatePRInput opens a new pull request.

type CreateReleaseInput added in v0.18.1

type CreateReleaseInput struct {
	Owner           string `wick:"required;desc=Repository owner."`
	Repo            string `wick:"required;desc=Repository name."`
	TagName         string `wick:"required;desc=Git tag to create/use for the release. Example: v1.2.0"`
	Name            string `wick:"desc=Release title. Default: the tag name."`
	Body            string `wick:"textarea;desc=Release notes (Markdown supported)."`
	TargetCommitish string `wick:"desc=Branch or commit the tag is created from. Default: default branch."`
	Draft           bool   `wick:"desc=Create as a draft (unpublished). Default: false."`
	Prerelease      bool   `wick:"desc=Mark as a pre-release. Default: false."`
}

CreateReleaseInput publishes a new release.

type DeleteReleaseInput added in v0.18.1

type DeleteReleaseInput struct {
	Owner     string `wick:"required;desc=Repository owner."`
	Repo      string `wick:"required;desc=Repository name."`
	ReleaseID int    `wick:"required;desc=Release ID to delete."`
}

DeleteReleaseInput removes a release.

type GetFileInput

type GetFileInput struct {
	Owner string `wick:"required;desc=Repository owner."`
	Repo  string `wick:"required;desc=Repository name."`
	Path  string `wick:"required;desc=File path in repo. Example: README.md or src/main.go"`
	Ref   string `wick:"desc=Branch, tag, or commit SHA. Default: repo default branch."`
}

GetFileInput reads a file from a repository.

type GetIssueInput added in v0.18.1

type GetIssueInput struct {
	Owner  string `wick:"required;desc=Repository owner."`
	Repo   string `wick:"required;desc=Repository name."`
	Number int    `wick:"required;desc=Issue number."`
}

GetIssueInput fetches a single issue.

type GetLatestReleaseInput added in v0.18.1

type GetLatestReleaseInput struct {
	Owner string `wick:"required;desc=Repository owner."`
	Repo  string `wick:"required;desc=Repository name."`
}

GetLatestReleaseInput fetches the latest published release.

type GetMeInput added in v0.18.1

type GetMeInput struct{}

GetMeInput fetches the authenticated user. Takes no arguments.

type GetPRDiffInput added in v0.18.1

type GetPRDiffInput struct {
	Owner    string `wick:"required;desc=Repository owner."`
	Repo     string `wick:"required;desc=Repository name."`
	Number   int    `wick:"required;desc=PR number."`
	MaxBytes int    `wick:"desc=Truncate diff to this many bytes; 0 = no limit."`
}

GetPRDiffInput fetches the unified diff for a pull request.

type GetPRInput added in v0.18.1

type GetPRInput struct {
	Owner  string `wick:"required;desc=Repository owner."`
	Repo   string `wick:"required;desc=Repository name."`
	Number int    `wick:"required;desc=PR number."`
}

GetPRInput fetches a single pull request.

type GetReleaseInput added in v0.18.1

type GetReleaseInput struct {
	Owner     string `wick:"required;desc=Repository owner."`
	Repo      string `wick:"required;desc=Repository name."`
	ReleaseID int    `wick:"required;desc=Release ID (numeric, from list_releases)."`
}

GetReleaseInput fetches a single release by ID.

type GetRepoInput added in v0.18.1

type GetRepoInput struct {
	Owner string `wick:"required;desc=Repository owner."`
	Repo  string `wick:"required;desc=Repository name."`
}

GetRepoInput fetches a single repository.

type ListBranchesInput added in v0.18.1

type ListBranchesInput struct {
	Owner   string `wick:"required;desc=Repository owner."`
	Repo    string `wick:"required;desc=Repository name."`
	PerPage int    `wick:"desc=Results per page, max 100. Default: 30."`
}

ListBranchesInput lists branches in a repository.

type ListCommitsInput added in v0.18.1

type ListCommitsInput struct {
	Owner   string `wick:"required;desc=Repository owner."`
	Repo    string `wick:"required;desc=Repository name."`
	Sha     string `wick:"desc=Branch, tag, or commit SHA to start listing from."`
	Path    string `wick:"desc=Only commits touching this file path."`
	Author  string `wick:"desc=Filter by commit author (GitHub login or email)."`
	PerPage int    `wick:"desc=Results per page, max 100. Default: 30."`
}

ListCommitsInput lists commits in a repository.

type ListForksInput added in v0.18.1

type ListForksInput struct {
	Owner   string `wick:"required;desc=Repository owner."`
	Repo    string `wick:"required;desc=Repository name."`
	PerPage int    `wick:"desc=Results per page, max 100. Default: 30."`
}

ListForksInput lists the forks of a repository (who forked it).

type ListIssueCommentsInput added in v0.18.1

type ListIssueCommentsInput struct {
	Owner   string `wick:"required;desc=Repository owner."`
	Repo    string `wick:"required;desc=Repository name."`
	Number  int    `wick:"required;desc=Issue or PR number."`
	PerPage int    `wick:"desc=Results per page, max 100. Default: 30."`
}

ListIssueCommentsInput lists comments on an issue or PR.

type ListIssuesInput

type ListIssuesInput struct {
	Owner   string `wick:"required;desc=Repository owner (user or org). Example: octocat"`
	Repo    string `wick:"required;desc=Repository name. Example: hello-world"`
	State   string `wick:"desc=open | closed | all. Default: open."`
	PerPage int    `wick:"desc=Results per page, max 100. Default: 30."`
}

ListIssuesInput lists issues in a repository.

type ListPRFilesInput added in v0.18.1

type ListPRFilesInput struct {
	Owner   string `wick:"required;desc=Repository owner."`
	Repo    string `wick:"required;desc=Repository name."`
	Number  int    `wick:"required;desc=PR number."`
	PerPage int    `wick:"desc=Results per page, max 100. Default: 30."`
}

ListPRFilesInput lists the files changed in a pull request.

type ListPRsInput

type ListPRsInput struct {
	Owner   string `wick:"required;desc=Repository owner."`
	Repo    string `wick:"required;desc=Repository name."`
	State   string `wick:"desc=open | closed | all. Default: open."`
	PerPage int    `wick:"desc=Results per page, max 100. Default: 30."`
}

ListPRsInput lists pull requests.

type ListReleasesInput added in v0.18.1

type ListReleasesInput struct {
	Owner   string `wick:"required;desc=Repository owner."`
	Repo    string `wick:"required;desc=Repository name."`
	PerPage int    `wick:"desc=Results per page, max 100. Default: 30."`
}

ListReleasesInput lists releases in a repository.

type ListReposInput

type ListReposInput struct {
	Affiliation string `wick:"desc=Comma-separated: owner,collaborator,organization_member. Default: owner."`
	Visibility  string `wick:"desc=all | public | private. Default: all."`
	PerPage     int    `wick:"desc=Results per page, max 100. Default: 30."`
}

ListReposInput lists repositories visible to the token.

type ListStargazersInput added in v0.18.1

type ListStargazersInput struct {
	Owner   string `wick:"required;desc=Repository owner."`
	Repo    string `wick:"required;desc=Repository name."`
	PerPage int    `wick:"desc=Results per page, max 100. Default: 30."`
}

ListStargazersInput lists the users who starred a repository.

type ListTagsInput added in v0.18.1

type ListTagsInput struct {
	Owner   string `wick:"required;desc=Repository owner."`
	Repo    string `wick:"required;desc=Repository name."`
	PerPage int    `wick:"desc=Results per page, max 100. Default: 30."`
}

ListTagsInput lists tags in a repository.

type MergePRInput added in v0.18.1

type MergePRInput struct {
	Owner         string `wick:"required;desc=Repository owner."`
	Repo          string `wick:"required;desc=Repository name."`
	Number        int    `wick:"required;desc=PR number."`
	MergeMethod   string `wick:"desc=merge | squash | rebase. Default merge."`
	CommitTitle   string `wick:"desc=Title for the merge commit. Default: GitHub's auto-generated title."`
	CommitMessage string `wick:"textarea;desc=Extra detail appended to the merge commit message."`
}

MergePRInput merges a pull request.

type StarRepoInput added in v0.18.1

type StarRepoInput struct {
	Owner string `wick:"required;desc=Repository owner."`
	Repo  string `wick:"required;desc=Repository name."`
}

StarRepoInput stars a repository for the authenticated user.

type UnstarRepoInput added in v0.18.1

type UnstarRepoInput struct {
	Owner string `wick:"required;desc=Repository owner."`
	Repo  string `wick:"required;desc=Repository name."`
}

UnstarRepoInput removes a star from a repository.

type UpdateIssueInput added in v0.18.1

type UpdateIssueInput struct {
	Owner  string `wick:"required;desc=Repository owner."`
	Repo   string `wick:"required;desc=Repository name."`
	Number int    `wick:"required;desc=Issue number."`
	Title  string `wick:"desc=New issue title. Omit to leave unchanged."`
	Body   string `wick:"textarea;desc=New issue body (Markdown). Omit to leave unchanged."`
	State  string `wick:"desc=open | closed. Omit to leave unchanged."`
	Labels string `wick:"desc=Comma-separated label names; replaces the existing set. Omit to leave unchanged."`
}

UpdateIssueInput edits an existing issue.

type UpdatePRInput added in v0.18.1

type UpdatePRInput struct {
	Owner  string `wick:"required;desc=Repository owner."`
	Repo   string `wick:"required;desc=Repository name."`
	Number int    `wick:"required;desc=PR number."`
	Title  string `wick:"desc=New PR title. Omit to leave unchanged."`
	Body   string `wick:"textarea;desc=New PR body (Markdown). Omit to leave unchanged."`
	State  string `wick:"desc=open | closed. Omit to leave unchanged."`
	Base   string `wick:"desc=New base branch. Omit to leave unchanged."`
}

UpdatePRInput edits an existing pull request.

type UpdateReleaseInput added in v0.18.1

type UpdateReleaseInput struct {
	Owner      string `wick:"required;desc=Repository owner."`
	Repo       string `wick:"required;desc=Repository name."`
	ReleaseID  int    `wick:"required;desc=Release ID to update."`
	TagName    string `wick:"desc=New git tag. Omit to leave unchanged."`
	Name       string `wick:"desc=New release title. Omit to leave unchanged."`
	Body       string `wick:"textarea;desc=New release notes (Markdown). Omit to leave unchanged."`
	Draft      bool   `wick:"desc=Set draft state. Sent only when true."`
	Prerelease bool   `wick:"desc=Set pre-release state. Sent only when true."`
}

UpdateReleaseInput edits an existing release.

Jump to

Keyboard shortcuts

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