src

package
v0.0.0-...-e0ceb2d Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultBatchSize = 0

DefaultBatchSize of 0 means no batching (push all refs at once, original behavior)

View Source
const MinBatchSize = 10

MinBatchSize is the minimum allowed batch size when batching is enabled

Variables

View Source
var (
	NwoRegExp        = regexp.MustCompile(`^[^/\s]+/[^/\s]+$`)
	ErrEmptyRepoList = errors.New("repo list cannot be empty")
	ErrEmptyCacheDir = errors.New("cache directory contains no actions to sync")
)

Functions

func GetImpersonationToken

func GetImpersonationToken(ctx context.Context, flags *PushFlags) (string, error)

func Pull

func Pull(ctx context.Context, flags *PullFlags) error

func PullManyWithGitImpl

func PullManyWithGitImpl(ctx context.Context, sourceURL string, auth transport.AuthMethod, cacheDir string, defaultBranchOnly bool, repoNames []string, gitimpl GitImplementation) error

func PullWithGitImpl

func PullWithGitImpl(ctx context.Context, sourceURL string, auth transport.AuthMethod, cacheDir string, defaultBranchOnly bool, repoName string, gitimpl GitImplementation) error

func Push

func Push(ctx context.Context, flags *PushFlags) error

func PushManyWithGitImpl

func PushManyWithGitImpl(ctx context.Context, flags *PushFlags, repoNames []string, ghClient *github.Client, gitimpl GitImplementation) error

func PushWithGitImpl

func PushWithGitImpl(ctx context.Context, flags *PushFlags, repoName string, ghClient *github.Client, gitimpl GitImplementation) error

func Sync

func Sync(ctx context.Context, flags *SyncFlags) error

Types

type CommonFlags

type CommonFlags struct {
	CacheDir, RepoName, RepoNameList, RepoNameListFile string
}

flags common to pull, push and sync operations

func (*CommonFlags) HasAtLeastOneRepoFlag

func (f *CommonFlags) HasAtLeastOneRepoFlag() bool

func (*CommonFlags) Init

func (f *CommonFlags) Init(cmd *cobra.Command)

func (*CommonFlags) Validate

func (f *CommonFlags) Validate(reposRequired bool) Validations

type GitImplementation

type GitImplementation interface {
	NewGitRepository(dir string) (GitRepository, error)
	CloneRepository(dir string, o *git.CloneOptions) (GitRepository, error)
	RepositoryExists(dir string) bool
}

type GitRemote

type GitRemote interface {
	PushContext(context.Context, *git.PushOptions) error
	Config() *config.RemoteConfig
}

type GitRepository

type GitRepository interface {
	DeleteRemote(string) error
	CreateRemote(*config.RemoteConfig) (GitRemote, error)
	FetchContext(context.Context, *git.FetchOptions) error
	References() (storer.ReferenceIter, error)
	Head() (*plumbing.Reference, error)
}

type PullFlags

type PullFlags struct {
	CommonFlags
	PullOnlyFlags
}

func (*PullFlags) Init

func (f *PullFlags) Init(cmd *cobra.Command)

func (*PullFlags) Validate

func (f *PullFlags) Validate() Validations

type PullOnlyFlags

type PullOnlyFlags struct {
	SourceURL, Token  string
	DefaultBranchOnly bool
}

func (*PullOnlyFlags) Init

func (f *PullOnlyFlags) Init(cmd *cobra.Command)

func (*PullOnlyFlags) Validate

func (f *PullOnlyFlags) Validate() Validations

type PushFlags

type PushFlags struct {
	CommonFlags
	PushOnlyFlags
}

func (*PushFlags) Init

func (f *PushFlags) Init(cmd *cobra.Command)

func (*PushFlags) Validate

func (f *PushFlags) Validate() Validations

type PushOnlyFlags

type PushOnlyFlags struct {
	BaseURL, Token, ActionsAdminUser string
	DisableGitAuth, GitHubApp        bool
	BatchSize                        int
}

func (*PushOnlyFlags) Init

func (f *PushOnlyFlags) Init(cmd *cobra.Command)

func (*PushOnlyFlags) Validate

func (f *PushOnlyFlags) Validate() Validations

type SyncFlags

type SyncFlags struct {
	CommonFlags
	PullOnlyFlags
	PushOnlyFlags
}

func (*SyncFlags) Init

func (f *SyncFlags) Init(cmd *cobra.Command)

func (*SyncFlags) Validate

func (f *SyncFlags) Validate() Validations

type Validations

type Validations []string

func (Validations) Error

func (v Validations) Error() error

func (Validations) Join

Jump to

Keyboard shortcuts

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