Documentation
¶
Index ¶
- Variables
- func DescribeHead(ctx context.Context, repoPath string) (string, error)
- func Fetch(ctx context.Context, input FetchInput) error
- func GetRepositoryName(ctx context.Context, repoPath, githubInstance, remoteName string) (string, error)
- func ResolveHead(ctx context.Context, repoPath string) (shortSha, sha string, err error)
- func ResolveRevision(ctx context.Context, repoPath, rev string) (string, error)
- type CloneInput
- type Error
- type FetchInput
- type Worktree
Constants ¶
This section is empty.
Variables ¶
var (
ErrShortRef = errors.New("short SHA references are not supported")
)
Functions ¶
func DescribeHead ¶ added in v12.5.0
DescribeHead resolves the symbolic name (tag or branch) of HEAD.
func GetRepositoryName ¶ added in v12.5.0
func GetRepositoryName(ctx context.Context, repoPath, githubInstance, remoteName string) (string, error)
GetRepositoryName determines the name of a repository (for example, `actions/checkout`) by extracting it from the URL of the remote with the given remoteName.
func ResolveHead ¶ added in v12.5.0
ResolveHead determines the commit ID of the current HEAD.
Types ¶
type CloneInput ¶
type CloneInput struct {
CacheDir string // parent-location for all git caches that the runner maintains
URL string // url of the remote to clone
Ref string // reference from the remote; eg. tag, branch, or sha
Token string // authentication token
OfflineMode bool // when true, no remote operations will occur
InsecureSkipTLS bool // when true, TLS verification will be skipped on remote operations
}
CloneInput is a parameter struct for the method `Clone` to simplify the multiple parameters required.
type FetchInput ¶ added in v12.5.0
type FetchInput struct {
// contains filtered or unexported fields
}
type Worktree ¶
type Worktree interface {
Close(ctx context.Context) error
WorktreeDir() string // fully qualified path to the work tree for this repo
}
func Clone ¶
func Clone(ctx context.Context, input CloneInput) (Worktree, error)
Clones a git repo. The repo contents are stored opaquely in the provided `CacheDir`, and may be reused by future clone operations. The returned value contains a path to the working tree that can be used to interact with the requested ref; it must be closed to indicate operations against it are complete.