github

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFileURL added in v0.0.4

func GenerateFileURL(repoURL, filePath string, lineNumber int) string

GenerateFileURL creates a GitHub URL pointing to a specific line in a file

func GenerateFileURLWithBranch added in v0.0.7

func GenerateFileURLWithBranch(repoURL, filePath string, lineNumber int, branch string) string

GenerateFileURLWithBranch creates a GitHub URL using an explicit branch name (no SHA).

func IsGitHubRepository added in v0.0.4

func IsGitHubRepository(repoURL string) bool

IsGitHubRepository checks if a repository URL is a GitHub repository

func ParseRepositoryURL

func ParseRepositoryURL(repoURL string) (owner, repo string, err error)

ParseRepositoryURL parses a GitHub repository URL

Types

type Client

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

Client represents a GitHub API client

func NewClient

func NewClient() *Client

NewClient creates a new GitHub API client

func NewClientWithSmartAuth added in v0.0.5

func NewClientWithSmartAuth(providedToken string) (*Client, string)

NewClientWithSmartAuth creates a GitHub client with intelligent authentication

func NewClientWithToken added in v0.0.5

func NewClientWithToken(token string) *Client

NewClientWithToken creates a new GitHub API client with the provided token

func (*Client) CloneRepository

func (c *Client) CloneRepository(repoURL, destDir string) (string, error)

CloneRepository clones a GitHub repository to a local directory

func (*Client) CloneRepositoryWithBranch added in v1.0.1

func (c *Client) CloneRepositoryWithBranch(repoURL, destDir, branch string) (string, error)

CloneRepositoryWithBranch clones a specific branch of a GitHub repository

func (*Client) CloneRepositoryWithProgress added in v0.0.4

func (c *Client) CloneRepositoryWithProgress(repoURL, destDir string, showProgress bool, progressCallback func(progress int, stage string)) (string, error)

CloneRepositoryWithProgress clones a GitHub repository with optional progress reporting

func (*Client) CloneRepositoryWithProgressAndBranch added in v1.0.1

func (c *Client) CloneRepositoryWithProgressAndBranch(repoURL, destDir, branch string, showProgress bool, progressCallback func(progress int, stage string)) (string, error)

CloneRepositoryWithProgressAndBranch clones a GitHub repository with optional progress reporting and branch selection

func (*Client) CreateCheckRun

func (c *Client) CreateCheckRun(owner, repo, sha string, findings []string) error

CreateCheckRun creates a GitHub check run for a commit

func (*Client) CreateIssueComment

func (c *Client) CreateIssueComment(owner, repo string, number int, body string) error

CreateIssueComment creates a comment on a GitHub issue or pull request

func (*Client) DiscoverOrganizationRepositories added in v0.0.4

func (c *Client) DiscoverOrganizationRepositories(orgName string, filter interface{}) ([]RepositoryInfo, error)

DiscoverOrganizationRepositories discovers all repositories in a GitHub organization

func (*Client) DownloadWorkflowFiles

func (c *Client) DownloadWorkflowFiles(owner, repo, destDir string) ([]string, error)

DownloadWorkflowFiles downloads workflow files to a local directory

func (*Client) GetDefaultBranch added in v1.0.1

func (c *Client) GetDefaultBranch(owner, repo string) (string, error)

GetDefaultBranch gets the default branch name for a repository

func (*Client) GetLatestRelease added in v1.0.2

func (c *Client) GetLatestRelease(owner, repo string) (string, time.Time, error)

GetLatestRelease fetches the latest release tag for a GitHub Action (owner/repo)

func (*Client) GetWorkflowFiles

func (c *Client) GetWorkflowFiles(owner, repo string) ([]*github.RepositoryContent, error)

GetWorkflowFiles gets the GitHub Actions workflow files from a repository

func (*Client) GetWorkflowFilesContents added in v0.0.7

func (c *Client) GetWorkflowFilesContents(owner, repo string) (map[string][]byte, error)

GetWorkflowFilesContents fetches all workflow files from a repository using the GitHub API.

type RepositoryFilter added in v0.0.5

type RepositoryFilter struct {
	IncludeForks    bool   // Include forked repositories
	IncludeArchived bool   // Include archived repositories
	IncludePrivate  bool   // Include private repositories
	IncludePublic   bool   // Include public repositories
	MaxRepos        int    // Maximum number of repositories to analyze (0 = no limit)
	NameFilter      string // Regular expression to filter repository names
}

RepositoryFilter defines criteria for filtering repositories during organization analysis

type RepositoryInfo added in v0.0.4

type RepositoryInfo struct {
	Name          string `json:"name"`
	FullName      string `json:"full_name"`
	URL           string `json:"url"`
	CloneURL      string `json:"clone_url"`
	DefaultBranch string `json:"default_branch,omitempty"`
	IsPrivate     bool   `json:"is_private"`
	IsFork        bool   `json:"is_fork"`
	IsArchived    bool   `json:"is_archived"`
	Language      string `json:"language,omitempty"`
	Description   string `json:"description,omitempty"`
	UpdatedAt     string `json:"updated_at,omitempty"`
}

RepositoryInfo represents basic information about a repository

Jump to

Keyboard shortcuts

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