Documentation
¶
Index ¶
- type Author
- type Commit
- type PullRequest
- type Releases
- type Repository
- func (r *Repository) Checkout(_ context.Context, branch string) error
- func (r *Repository) Commit(_ context.Context, message string, author Author) (Commit, error)
- func (r *Repository) DeleteBranch(ctx context.Context, branch string) error
- func (r *Repository) ForcePush(ctx context.Context, branch string) error
- func (r *Repository) HasChangesWithRemote(ctx context.Context, mainBranch, prBranch string) (bool, error)
- func (r *Repository) UpdateFile(_ context.Context, path string, create bool, ...) error
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commit ¶
type Commit struct {
Hash string
Message string
PullRequest *PullRequest
}
type PullRequest ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func CloneRepo ¶
func CloneRepo(ctx context.Context, logger *slog.Logger, cloneURL, branch string, auth transport.AuthMethod) (*Repository, error)
func (*Repository) DeleteBranch ¶
func (r *Repository) DeleteBranch(ctx context.Context, branch string) error
func (*Repository) ForcePush ¶
func (r *Repository) ForcePush(ctx context.Context, branch string) error
func (*Repository) HasChangesWithRemote ¶
func (r *Repository) HasChangesWithRemote(ctx context.Context, mainBranch, prBranch string) (bool, error)
HasChangesWithRemote checks if the following two diffs are equal:
- **Local**: remote/main..branch - **Remote**: (git merge-base remote/main remote/branch)..remote/branch
This is done to avoid pushing when the only change would be a rebase of remote/branch onto the current remote/main.
Click to show internal directories.
Click to hide internal directories.