{"modulePath":"github.com/nrkno/github-action-semantic-release","version":"v0.14.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\nPackage github provides GitHub API interactions.\n\n## Variables\n\n```go\nvar (\n\tErrUnauthorized  = errors.New(\"unauthorized: GITHUB_TOKEN is missing or expired\")\n\tErrForbidden     = errors.New(\"forbidden: GITHUB_TOKEN lacks required permissions\")\n\tErrNotFound      = errors.New(\"not found: resource does not exist\")\n\tErrUnprocessable = errors.New(\"unprocessable: GitHub API rejected request\")\n\tErrRateLimited   = errors.New(\"rate limited: GitHub API rate limit exceeded\")\n\tErrServerError   = errors.New(\"server error: GitHub API returned 5xx\")\n)\n```\nTyped errors for GitHub API responses.\n\n## Types\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient wraps the go-github client.\n\n```go\nfunc NewClient(token, baseURL string) (*Client, error)\n```\nNewClient constructs a GitHub API client. baseURL is the value of GITHUB\\_API\\_URL (may be empty or without trailing slash). For the default GitHub.com API URL, the standard client is returned. For any other non-empty URL (GHES), WithEnterpriseURLs is used. A trailing slash is added automatically — go-github v60 requires it.\n\n```go\nfunc (c *Client) CreateRelease(ctx context.Context, owner, repo string, opts CreateReleaseOptions) (*Release, error)\n```\nCreateRelease creates a new GitHub release. On HTTP 422 with errors\\[].code == \"already\\_exists\", calls GetReleaseByTag and returns that result. Returns (Release, nil) on success, typed errors on other failures.\n\n```go\nfunc (c *Client) FindPRComment(ctx context.Context, owner, repo string, prNumber int, marker string) (bool, error)\n```\nFindPRComment searches for an existing comment on a PR by marker string. marker: substring to search for in comment body (e.g., \"\\\u003c!-- semrel-notify:v1.4.0 --\u003e\") Returns (true, nil) if found, (false, nil) if not found, (false, error) on API failure.\n\n```go\nfunc (c *Client) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*Release, error)\n```\nGetReleaseByTag retrieves a release by tag name. Returns (Release, nil) on 200, typed errors on other status codes.\n\n```go\nfunc (c *Client) ListPRsForCommit(ctx context.Context, owner, repo, sha string) ([]PR, error)\n```\nListPRsForCommit retrieves all PRs associated with a commit SHA. Calls GET /repos/{owner}/{repo}/commits/{sha}/pulls Returns (\\[]PR, nil) on success, typed errors on failure.\n\n```go\nfunc (c *Client) PostPRComment(ctx context.Context, owner, repo string, prNumber int, body string) error\n```\nPostPRComment posts a comment on a pull request. Returns nil on success, typed errors on failure.\n\n```go\nfunc (c *Client) SearchPRsForCommit(ctx context.Context, query string) ([]PR, error)\n```\nSearchPRsForCommit searches for PRs using a query string. Calls GET /search/issues?q=\\\u003cquery\u003e Returns (\\[]PR, nil) on success, typed errors on failure.\n\n```go\ntype CreateReleaseOptions struct {\n\tTagName string\n\tName    string\n\tBody    string\n}\n```\nCreateReleaseOptions for CreateRelease.\n\n```go\ntype PR struct {\n\tNumber int\n\tURL    string\n\tTitle  string\n}\n```\nPR represents a GitHub pull request.\n\n```go\ntype Release struct {\n\tID      int64\n\tTagName string\n\tHTMLURL string\n\tBody    string\n}\n```\nRelease represents a GitHub release.\n\n","path":"github.com/nrkno/github-action-semantic-release/internal/github","name":"github","synopsis":"Package github provides GitHub API interactions.","isRedistributable":true}
