Dagger
Search

gh

GitHub CLI

Installation

dagger install github.com/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee

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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
func (m *MyModule) Example() *dagger.Gh  {
	return dag.
			Gh()
}
@function
def example() -> dagger.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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 source
func (m *MyModule) Example() *dagger.Directory  {
	return dag.
			Gh().
			Source()
}
@function
def example() -> dagger.Directory:
	return (
		dag.gh()
		.source()
	)
@func()
example(): Directory {
	return dag
		.gh()
		.source()
}

clone() 🔗

Clone a GitHub repository.

Return Type
Gh !
Arguments
NameTypeDefault ValueDescription
repoString -

GitHub repository (e.g. “owner/repo”).

Example
dagger -m github.com/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 clone
func (m *MyModule) Example() *dagger.Gh  {
	return dag.
			Gh().
			Clone()
}
@function
def example() -> dagger.Gh:
	return (
		dag.gh()
		.clone()
	)
@func()
example(): Gh {
	return dag
		.gh()
		.clone()
}

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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 exec --args string1 --args string2
func (m *MyModule) Example(args []string) *dagger.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)
}

pullRequest() 🔗

Work with GitHub pull requests.

Return Type
PullRequest !
Example
dagger -m github.com/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 pull-request
func (m *MyModule) Example() *dagger.GhPullRequest  {
	return dag.
			Gh().
			PullRequest()
}
@function
def example() -> dagger.GhPullRequest:
	return (
		dag.gh()
		.pull_request()
	)
@func()
example(): GhPullRequest {
	return dag
		.gh()
		.pullRequest()
}

release() 🔗

Manage releases.

Return Type
Release !
Example
dagger -m github.com/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 release
func (m *MyModule) Example() *dagger.GhRelease  {
	return dag.
			Gh().
			Release()
}
@function
def example() -> dagger.GhRelease:
	return (
		dag.gh()
		.release()
	)
@func()
example(): GhRelease {
	return dag
		.gh()
		.release()
}

repo() 🔗

Work with GitHub repositories.

Return Type
Repo !
Example
dagger -m github.com/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 repo
func (m *MyModule) Example() *dagger.GhRepo  {
	return dag.
			Gh().
			Repo()
}
@function
def example() -> dagger.GhRepo:
	return (
		dag.gh()
		.repo()
	)
@func()
example(): GhRepo {
	return dag
		.gh()
		.repo()
}

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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 run --cmd string
func (m *MyModule) Example(cmd string) *dagger.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)
}

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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 terminal
func (m *MyModule) Example() *dagger.Container  {
	return dag.
			Gh().
			Terminal()
}
@function
def example() -> dagger.Container:
	return (
		dag.gh()
		.terminal()
	)
@func()
example(): Container {
	return dag
		.gh()
		.terminal()
}

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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 with-git-exec --args string1 --args string2
func (m *MyModule) Example(args []string) *dagger.Gh  {
	return dag.
			Gh().
			WithGitExec(args)
}
@function
def example(args: List[str]) -> dagger.Gh:
	return (
		dag.gh()
		.with_git_exec(args)
	)
@func()
example(args: string[]): Gh {
	return dag
		.gh()
		.withGitExec(args)
}

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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 with-repo --repo string
func (m *MyModule) Example(repo string) *dagger.Gh  {
	return dag.
			Gh().
			WithRepo(repo)
}
@function
def example(repo: str) -> dagger.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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 with-source --source DIR_PATH
func (m *MyModule) Example(source *dagger.Directory) *dagger.Gh  {
	return dag.
			Gh().
			WithSource(source)
}
@function
def example(source: dagger.Directory) -> dagger.Gh:
	return (
		dag.gh()
		.with_source(source)
	)
@func()
example(source: Directory): Gh {
	return dag
		.gh()
		.withSource(source)
}

withToken() 🔗

Set a GitHub token.

Return Type
Gh !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-

GitHub token.

Example
dagger -m github.com/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 with-token --token env:MYSECRET
func (m *MyModule) Example(token *dagger.Secret) *dagger.Gh  {
	return dag.
			Gh().
			WithToken(token)
}
@function
def example(token: dagger.Secret) -> dagger.Gh:
	return (
		dag.gh()
		.with_token(token)
	)
@func()
example(token: Secret): Gh {
	return dag
		.gh()
		.withToken(token)
}

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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee 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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee 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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 pull-request \
 review --pull-request string
func (m *MyModule) Example(pullRequest string) *dagger.GhPullRequestReview  {
	return dag.
			Gh().
			PullRequest().
			Review(pullRequest)
}
@function
def example(pull_request: str) -> dagger.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 "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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee 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)
}

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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee call \
 repo \
 clone --repository string
func (m *MyModule) Example(repository string) *dagger.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)
}

PullRequestReview 🔗

TODO: revisit if these should be private

approve() 🔗

Approve a pull request.

Return Type
Void !
Example
dagger -m github.com/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee 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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee 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/vito/dagger/toolchains/release/gh@1be1867fd879109586a39d8a8d999eaf44604fee 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()
}