Dagger
Search

gh

GitHub CLI

Installation

dagger install github.com/sagikazarmark/daggerverse/gh@v0.9.0

Entrypoint

Return Type
Gh !
Arguments
NameTypeDefault ValueDescription
tokenSecret -GitHub token.
repoString -GitHub repository (e.g. "owner/repo").
sourceDirectory -Git repository source (with .git directory).
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
func (m *myModule) example() *Gh  {
	return dag.
			Gh()
}
@function
def example() -> dag.Gh:
	return (
		dag.gh()
	)
@func()
example(): Gh {
	return dag
		.gh()
}

Types

Gh 🔗

source() 🔗

Git repository source (with .git directory).

Return Type
Directory !
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 source
func (m *myModule) example() *Directory  {
	return dag.
			Gh().
			Source()
}
@function
def example() -> dagger.Directory:
	return (
		dag.gh()
		.source()
	)
@func()
example(): Directory {
	return dag
		.gh()
		.source()
}

withToken() 🔗

Set a GitHub token.

Return Type
Gh !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-GitHub token.
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 with-token --token env:MYSECRET
func (m *myModule) example(token *Secret) *Gh  {
	return dag.
			Gh().
			WithToken(token)
}
@function
def example(token: dagger.Secret) -> dag.Gh:
	return (
		dag.gh()
		.with_token(token)
	)
@func()
example(token: Secret): Gh {
	return dag
		.gh()
		.withToken(token)
}

withRepo() 🔗

Set a GitHub repository as context.

Return Type
Gh !
Arguments
NameTypeDefault ValueDescription
repoString !-GitHub repository (e.g. "owner/repo").
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 with-repo --repo string
func (m *myModule) example(repo string) *Gh  {
	return dag.
			Gh().
			WithRepo(repo)
}
@function
def example(repo: str) -> dag.Gh:
	return (
		dag.gh()
		.with_repo(repo)
	)
@func()
example(repo: string): Gh {
	return dag
		.gh()
		.withRepo(repo)
}

withSource() 🔗

Load a Git repository source (with .git directory).

Return Type
Gh !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-Git repository source (with .git directory).
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 with-source --source DIR_PATH
func (m *myModule) example(source *Directory) *Gh  {
	return dag.
			Gh().
			WithSource(source)
}
@function
def example(source: dagger.Directory) -> dag.Gh:
	return (
		dag.gh()
		.with_source(source)
	)
@func()
example(source: Directory): Gh {
	return dag
		.gh()
		.withSource(source)
}

clone() 🔗

Clone a GitHub repository.

Return Type
Gh !
Arguments
NameTypeDefault ValueDescription
repoString -GitHub repository (e.g. "owner/repo").
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 clone
func (m *myModule) example() *Gh  {
	return dag.
			Gh().
			Clone()
}
@function
def example() -> dag.Gh:
	return (
		dag.gh()
		.clone()
	)
@func()
example(): Gh {
	return dag
		.gh()
		.clone()
}

run() 🔗

Run a GitHub CLI command (accepts a single command string without “gh”).

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
cmdString !-Command to run.
tokenSecret -GitHub token.
repoString -GitHub repository (e.g. "owner/repo").
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 run --cmd string
func (m *myModule) example(cmd string) *Container  {
	return dag.
			Gh().
			Run(cmd)
}
@function
def example(cmd: str) -> dagger.Container:
	return (
		dag.gh()
		.run(cmd)
	)
@func()
example(cmd: string): Container {
	return dag
		.gh()
		.run(cmd)
}

exec() 🔗

Run a GitHub CLI command (accepts a list of arguments without “gh”).

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
args[String ! ] !-Arguments to pass to GitHub CLI.
tokenSecret -GitHub token.
repoString -GitHub repository (e.g. "owner/repo").
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 exec --args string1 --args string2
func (m *myModule) example(args []string) *Container  {
	return dag.
			Gh().
			Exec(args)
}
@function
def example(args: List[str]) -> dagger.Container:
	return (
		dag.gh()
		.exec(args)
	)
@func()
example(args: string[]): Container {
	return dag
		.gh()
		.exec(args)
}

withGitExec() 🔗

Run a git command (accepts a list of arguments without “git”).

Return Type
Gh !
Arguments
NameTypeDefault ValueDescription
args[String ! ] !-Arguments to pass to GitHub CLI.
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 with-git-exec --args string1 --args string2
func (m *myModule) example(args []string) *Gh  {
	return dag.
			Gh().
			WithGitExec(args)
}
@function
def example(args: List[str]) -> dag.Gh:
	return (
		dag.gh()
		.with_git_exec(args)
	)
@func()
example(args: string[]): Gh {
	return dag
		.gh()
		.withGitExec(args)
}

terminal() 🔗

Open an interactive terminal.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
tokenSecret -GitHub token.
repoString -GitHub repository (e.g. "owner/repo").
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 terminal
func (m *myModule) example() *Container  {
	return dag.
			Gh().
			Terminal()
}
@function
def example() -> dagger.Container:
	return (
		dag.gh()
		.terminal()
	)
@func()
example(): Container {
	return dag
		.gh()
		.terminal()
}

repo() 🔗

Work with GitHub repositories.

Return Type
Repo !
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 repo
func (m *myModule) example() *GhRepo  {
	return dag.
			Gh().
			Repo()
}
@function
def example() -> dag.GhRepo:
	return (
		dag.gh()
		.repo()
	)
@func()
example(): GhRepo {
	return dag
		.gh()
		.repo()
}

pullRequest() 🔗

Work with GitHub pull requests.

Return Type
PullRequest !
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 pull-request
func (m *myModule) example() *GhPullRequest  {
	return dag.
			Gh().
			PullRequest()
}
@function
def example() -> dag.GhPullRequest:
	return (
		dag.gh()
		.pull_request()
	)
@func()
example(): GhPullRequest {
	return dag
		.gh()
		.pullRequest()
}

release() 🔗

Manage releases.

Return Type
Release !
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 release
func (m *myModule) example() *GhRelease  {
	return dag.
			Gh().
			Release()
}
@function
def example() -> dag.GhRelease:
	return (
		dag.gh()
		.release()
	)
@func()
example(): GhRelease {
	return dag
		.gh()
		.release()
}

Repo 🔗

clone() 🔗

Clone a GitHub repository locally.

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
repositoryString !-No description provided
args[String ! ] -Additional arguments to pass to the "git clone" command.
tokenSecret -GitHub token.
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 repo \
 clone --repository string
func (m *myModule) example(repository string) *Directory  {
	return dag.
			Gh().
			Repo().
			Clone(repository)
}
@function
def example(repository: str) -> dagger.Directory:
	return (
		dag.gh()
		.repo()
		.clone(repository)
	)
@func()
example(repository: string): Directory {
	return dag
		.gh()
		.repo()
		.clone(repository)
}

PullRequest 🔗

create() 🔗

Create a pull request on GitHub.

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
assignees[String ! ] -Assign people by their login. Use "@me" to self-assign.
baseString -The branch into which you want your code merged.
bodyString -Body for the pull request.
bodyFileFile -Read body text from file.
draftBoolean -Mark pull request as a draft.
fillBoolean -Use commit info for title and body. (Requires repository source)
fillFirstBoolean -Use first commit info for title and body. (Requires repository source)
fillVerboseBoolean -Use commits msg+body for description. (Requires repository source)
headString -The branch that contains commits for your pull request (default [current branch], required when no repository source is available).
labels[String ! ] -Add labels by name.
milestoneString -Add the pull request to a milestone by name.
noMaintainerEditBoolean -Disable maintainer's ability to modify pull request.
projects[String ! ] -Add the pull request to projects by name.
reviewers[String ! ] -Request reviews from people or teams by their handle.
templateFile -Template file to use as starting body text.
titleString -Title for the pull request.
tokenSecret -GitHub token.
repoString -GitHub repository (e.g. "owner/repo").
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 pull-request \
 create
func (m *myModule) example(ctx context.Context)   {
	return dag.
			Gh().
			PullRequest().
			Create(ctx)
}
@function
async def example() -> None:
	return await (
		dag.gh()
		.pull_request()
		.create()
	)
@func()
async example(): Promise<void> {
	return dag
		.gh()
		.pullRequest()
		.create()
}

exists() 🔗

Check if a PR exists

Return Type
Boolean !
Arguments
NameTypeDefault ValueDescription
pullRequestString !-Pull request number, url or branch name.
tokenSecret -GitHub token.
repoString -GitHub repository (e.g. "owner/repo").
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 pull-request \
 exists --pull-request string
func (m *myModule) example(ctx context.Context, pullRequest string) bool  {
	return dag.
			Gh().
			PullRequest().
			Exists(ctx, pullRequest)
}
@function
async def example(pull_request: str) -> bool:
	return await (
		dag.gh()
		.pull_request()
		.exists(pull_request)
	)
@func()
async example(pullRequest: string): Promise<boolean> {
	return dag
		.gh()
		.pullRequest()
		.exists(pullRequest)
}

review() 🔗

Add a review to a pull request.

Return Type
PullRequestReview !
Arguments
NameTypeDefault ValueDescription
pullRequestString !-Pull request number, url or branch name.
bodyString -Specify the body of a review.
bodyFileFile -Read body text from file.
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 pull-request \
 review --pull-request string
func (m *myModule) example(pullRequest string) *GhPullRequestReview  {
	return dag.
			Gh().
			PullRequest().
			Review(pullRequest)
}
@function
def example(pull_request: str) -> dag.GhPullRequestReview:
	return (
		dag.gh()
		.pull_request()
		.review(pull_request)
	)
@func()
example(pullRequest: string): GhPullRequestReview {
	return dag
		.gh()
		.pullRequest()
		.review(pullRequest)
}

Release 🔗

create() 🔗

Create a new GitHub Release for a repository.

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
tagString !-Tag this release should point to or create.
titleString !-Release title.
files[File ! ] -Release assets to upload.
draftBoolean -Save the release as a draft instead of publishing it.
preReleaseBoolean -Mark the release as a prerelease.
targetString -Target branch or full commit SHA (default: main branch).
notesString -Release notes.
notesFileFile -Read release notes from file.
discussionCategoryString -Start a discussion in the specified category.
generateNotesBoolean -Automatically generate title and notes for the release.
notesStartTagString -Tag to use as the starting point for generating release notes.
latestEnum "LATEST_AUTO"Mark this release as "Latest" (default: automatic based on date and version).
verifyTagBoolean -Abort in case the git tag doesn't already exist in the remote repository.
notesFromTagBoolean -Tag to use as the starting point for generating release notes.
tokenSecret -GitHub token.
repoString -GitHub repository (e.g. "owner/repo").
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 release \
 create --tag string --title string
func (m *myModule) example(ctx context.Context, tag string, title string)   {
	return dag.
			Gh().
			Release().
			Create(ctx, tag, title)
}
@function
async def example(tag: str, title: str) -> None:
	return await (
		dag.gh()
		.release()
		.create(tag, title)
	)
@func()
async example(tag: string, title: string): Promise<void> {
	return dag
		.gh()
		.release()
		.create(tag, title)
}

PullRequestReview 🔗

TODO: revisit if these should be private

approve() 🔗

Approve a pull request.

Return Type
Void !
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 pull-request \
 review --pull-request string \
 approve
func (m *myModule) example(ctx context.Context, pullRequest string)   {
	return dag.
			Gh().
			PullRequest().
			Review(pullRequest).
			Approve(ctx)
}
@function
async def example(pull_request: str) -> None:
	return await (
		dag.gh()
		.pull_request()
		.review(pull_request)
		.approve()
	)
@func()
async example(pullRequest: string): Promise<void> {
	return dag
		.gh()
		.pullRequest()
		.review(pullRequest)
		.approve()
}

comment() 🔗

Comment on a pull request.

Return Type
Void !
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 pull-request \
 review --pull-request string \
 comment
func (m *myModule) example(ctx context.Context, pullRequest string)   {
	return dag.
			Gh().
			PullRequest().
			Review(pullRequest).
			Comment(ctx)
}
@function
async def example(pull_request: str) -> None:
	return await (
		dag.gh()
		.pull_request()
		.review(pull_request)
		.comment()
	)
@func()
async example(pullRequest: string): Promise<void> {
	return dag
		.gh()
		.pullRequest()
		.review(pullRequest)
		.comment()
}

requestChanges() 🔗

Request changes on a pull request.

Return Type
Void !
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@07e4b46e57583beb6fb737a35a56c017e80734a3 call \
 pull-request \
 review --pull-request string \
 request-changes
func (m *myModule) example(ctx context.Context, pullRequest string)   {
	return dag.
			Gh().
			PullRequest().
			Review(pullRequest).
			RequestChanges(ctx)
}
@function
async def example(pull_request: str) -> None:
	return await (
		dag.gh()
		.pull_request()
		.review(pull_request)
		.request_changes()
	)
@func()
async example(pullRequest: string): Promise<void> {
	return dag
		.gh()
		.pullRequest()
		.review(pullRequest)
		.requestChanges()
}