github

package
v0.0.0-...-1fd3d55 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRemoteHostIsNotGitHub = errors.New("not a github host")

Functions

func EnsureRemote

func EnsureRemote(ctx context.Context, repositoryPath string, remoteName string, gitCli git.GitCli) (string, error)

ensureRemote ensures that a git repository located at `repositoryPath` has a remote and it is configured with a URL for a repository hosted on GitHub. It returns the repository slug `(<organization>/<repo>)`.

func GetSlugForRemote

func GetSlugForRemote(remoteUrl string) (string, error)

Types

type FederatedTokenClient

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

FederatedTokenClient is a client that can be used to fetch federated access tokens when running in GitHub actions. It provides similar behavior to logic in the `@actions/core` JavaScript package that actions can use.

func NewFederatedTokenClient

func NewFederatedTokenClient(options *policy.ClientOptions) *FederatedTokenClient

func (*FederatedTokenClient) TokenForAudience

func (c *FederatedTokenClient) TokenForAudience(ctx context.Context, audience string) (string, error)

TokenForAudience gets the federated token from GitHub Actions. It follows the same strategy as the as the getIDToken function from `@actions/core`.

Jump to

Keyboard shortcuts

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