github

package
v0.0.0-...-f2e6f42 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ghClient *github.Client) interfaces.GitHubOperations

NewClient crea un nuevo cliente para interactuar con la API de GitHub. Acepta un cliente de go-github y extrae los servicios necesarios.

func NewClientForTest

NewClientForTest crea un cliente con servicios simulados para pruebas.

Types

type ActionsService

type ActionsService interface {
	RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*github.Response, error)
	RerunFailedJobsByID(ctx context.Context, owner, repo string, runID int64) (*github.Response, error)
}

ActionsService define la interfaz para interactuar con GitHub Actions.

type Client

type Client struct {
	Repositories   RepositoriesService
	PullRequests   PullRequestsService
	Issues         IssuesService
	Actions        ActionsService
	Dependabot     DependabotService
	CodeScanning   CodeScanningService
	SecretScanning SecretScanningService
}

Client implementa la interfaz GitHubOperations.

func (*Client) CloseIssue

func (c *Client) CloseIssue(ctx context.Context, owner, repo string, number int, comment string) (*github.Issue, error)

CloseIssue cierra un issue.

func (*Client) CreateFile

func (c *Client) CreateFile(ctx context.Context, owner, repo, path, content, message, branch string) (*github.RepositoryContentResponse, error)

CreateFile crea un nuevo archivo en un repositorio.

func (*Client) CreateIssueComment

func (c *Client) CreateIssueComment(ctx context.Context, owner, repo string, number int, body string) (*github.IssueComment, error)

CreateIssueComment crea un comentario en un issue.

func (*Client) CreatePRComment

func (c *Client) CreatePRComment(ctx context.Context, owner, repo string, number int, body string) (*github.IssueComment, error)

CreatePRComment crea un comentario en un pull request.

func (*Client) CreatePRReview

func (c *Client) CreatePRReview(ctx context.Context, owner, repo string, number int, event, body string) (*github.PullRequestReview, error)

CreatePRReview crea una review en un pull request.

func (*Client) CreatePullRequest

func (c *Client) CreatePullRequest(ctx context.Context, owner, repo, title, head, base, body string) (*github.PullRequest, error)

CreatePullRequest crea un nuevo pull request.

func (*Client) CreateRepository

func (c *Client) CreateRepository(ctx context.Context, name, description string, private bool) (*github.Repository, error)

CreateRepository crea un nuevo repositorio.

func (*Client) DismissCodeScanningAlert

func (c *Client) DismissCodeScanningAlert(ctx context.Context, owner, repo string, number int64, reason, comment string) (*github.Alert, error)

DismissCodeScanningAlert dismissa una alerta de code scanning.

func (*Client) DismissDependabotAlert

func (c *Client) DismissDependabotAlert(ctx context.Context, owner, repo string, number int, reason, comment string) (*github.DependabotAlert, error)

DismissDependabotAlert dismissa una alerta de Dependabot.

func (*Client) DismissSecretScanningAlert

func (c *Client) DismissSecretScanningAlert(ctx context.Context, owner, repo string, number int64, resolution string) (*github.SecretScanningAlert, error)

DismissSecretScanningAlert dismissa una alerta de secret scanning.

func (*Client) ListPullRequests

func (c *Client) ListPullRequests(ctx context.Context, owner, repo, state string) ([]*github.PullRequest, error)

ListPullRequests lista los pull requests de un repositorio.

func (*Client) ListRepositories

func (c *Client) ListRepositories(ctx context.Context, listType string) ([]*github.Repository, error)

ListRepositories lista los repositorios del usuario.

func (*Client) MergePullRequest

func (c *Client) MergePullRequest(ctx context.Context, owner, repo string, number int, commitMessage, mergeMethod string) (*github.PullRequestMergeResult, error)

MergePullRequest mergea un pull request.

func (*Client) RerunFailedJobs

func (c *Client) RerunFailedJobs(ctx context.Context, owner, repo string, runID int64) error

RerunFailedJobs re-ejecuta solo los jobs fallidos en un workflow.

func (*Client) RerunWorkflow

func (c *Client) RerunWorkflow(ctx context.Context, owner, repo string, runID int64) error

RerunWorkflow re-ejecuta un workflow.

func (*Client) UpdateFile

func (c *Client) UpdateFile(ctx context.Context, owner, repo, path, content, message, sha, branch string) (*github.RepositoryContentResponse, error)

UpdateFile actualiza un archivo existente en un repositorio.

type CodeScanningService

type CodeScanningService interface {
	UpdateAlert(ctx context.Context, owner, repo string, id int64, stateInfo *github.CodeScanningAlertState) (*github.Alert, *github.Response, error)
}

CodeScanningService define la interfaz para alertas de Code Scanning.

type DependabotService

type DependabotService interface {
	UpdateAlert(ctx context.Context, owner, repo string, number int, stateInfo *github.DependabotAlertState) (*github.DependabotAlert, *github.Response, error)
}

DependabotService define la interfaz para alertas de Dependabot.

type IssuesService

type IssuesService interface {
	CreateComment(ctx context.Context, owner, repo string, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
	Edit(ctx context.Context, owner, repo string, number int, issue *github.IssueRequest) (*github.Issue, *github.Response, error)
}

IssuesService define la interfaz para interactuar con la API de issues de GitHub.

type PullRequestsService

type PullRequestsService interface {
	List(ctx context.Context, owner, repo string, opts *github.PullRequestListOptions) ([]*github.PullRequest, *github.Response, error)
	Create(ctx context.Context, owner, repo string, pull *github.NewPullRequest) (*github.PullRequest, *github.Response, error)
	Merge(ctx context.Context, owner, repo string, number int, commitMessage string, opts *github.PullRequestOptions) (*github.PullRequestMergeResult, *github.Response, error)
	CreateReview(ctx context.Context, owner, repo string, number int, review *github.PullRequestReviewRequest) (*github.PullRequestReview, *github.Response, error)
}

PullRequestsService define la interfaz para interactuar con la API de pull requests de GitHub.

type RepositoriesService

RepositoriesService define la interfaz para interactuar con la API de repositorios de GitHub. Se utiliza para permitir la simulación del cliente de GitHub en las pruebas.

type SecretScanningService

type SecretScanningService interface {
	UpdateAlert(ctx context.Context, owner, repo string, number int64, opts *github.SecretScanningAlertUpdateOptions) (*github.SecretScanningAlert, *github.Response, error)
}

SecretScanningService define la interfaz para alertas de Secret Scanning.

Jump to

Keyboard shortcuts

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