Dagger
Search

gh

No long description provided.

Installation

dagger install github.com/adore-me/daggerverse/gh@0ba2b92c138708db1949b0552b6e6f13f3e5fdb2

Entrypoint

Return Type
Gh !
Arguments
NameTypeDescription
baseBranchString The base branch of the repository (ex: main, master)
tokenSecret !The token to authenticate with GitHub
Example
func (m *myModule) example(token *Secret) *Gh  {
	return dag.
			Gh(token)
}
@function
def example(token: dagger.Secret) -> dag.Gh:
	return (
		dag.gh(token)
	)
@func()
example(token: Secret): Gh {
	return dag
		.gh(token)
}

Types

Gh 🔗

runGit() 🔗

RunGit runs a command using the git CLI.

Example usage: dagger call –token=env:TOKEN –repo-path=“/workspace/repo” run-git –cmd=status

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
repoDirDirectory !-RepoDir of the GitHub repo
cmdString !-command to run
versionString "2.43.0"version of the Github CLI
userEmailString "action@github.com"user email
userNameString "GitHub Action"user name
Example
dagger -m github.com/adore-me/daggerverse/gh@0ba2b92c138708db1949b0552b6e6f13f3e5fdb2 call \
 --token env:MYSECRET run-git --repo-dir DIR_PATH --cmd string
func (m *myModule) example(token *Secret, repoDir *Directory, cmd string) *Container  {
	return dag.
			Gh(token).
			RunGit(repoDir, cmd)
}
@function
def example(token: dagger.Secret, repo_dir: dagger.Directory, cmd: str) -> dagger.Container:
	return (
		dag.gh(token)
		.run_git(repo_dir, cmd)
	)
@func()
example(token: Secret, repoDir: Directory, cmd: string): Container {
	return dag
		.gh(token)
		.runGit(repoDir, cmd)
}

runGh() 🔗

RunGh runs a command using the git CLI.

Example usage: dagger call –token=env:TOKEN –base-branch=main run-gh –cmd=“status” –repo-path=“/workspace/repo”

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repoPathDirectory !-RepoDir of the GitHub repo
cmdString !-command to run
versionString "2.47.0"version of the Github CLI
Example
dagger -m github.com/adore-me/daggerverse/gh@0ba2b92c138708db1949b0552b6e6f13f3e5fdb2 call \
 --token env:MYSECRET run-gh --repo-path DIR_PATH --cmd string
func (m *myModule) example(ctx context.Context, token *Secret, repoPath *Directory, cmd string) string  {
	return dag.
			Gh(token).
			RunGh(ctx, repoPath, cmd)
}
@function
async def example(token: dagger.Secret, repo_path: dagger.Directory, cmd: str) -> str:
	return await (
		dag.gh(token)
		.run_gh(repo_path, cmd)
	)
@func()
async example(token: Secret, repoPath: Directory, cmd: string): Promise<string> {
	return dag
		.gh(token)
		.runGh(repoPath, cmd)
}