gh
GitHub CLI
Installation
dagger install github.com/sagikazarmark/daggerverse/gh@v0.2.0
Entrypoint
Return Type
Gh !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
token | Secret | - | GitHub token. |
repo | String | - | GitHub repository (e.g. "owner/repo"). |
source | Directory | - | Git repository source (with .git directory). |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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()
}
repo() 🔗
Work with GitHub repositories.
Return Type
Repo !
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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()
}
withToken() 🔗
Set a GitHub token.
Return Type
Gh !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
token | Secret ! | - | GitHub token. |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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
Name | Type | Default Value | Description |
---|---|---|---|
repo | String ! | - | GitHub repository (e.g. "owner/repo"). |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | Git repository source (with .git directory). |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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
Name | Type | Default Value | Description |
---|---|---|---|
repo | String | - | GitHub repository (e.g. "owner/repo"). |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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
Name | Type | Default Value | Description |
---|---|---|---|
cmd | String ! | - | Command to run. |
token | Secret | - | GitHub token. |
repo | String | - | GitHub repository (e.g. "owner/repo"). |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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
Name | Type | Default Value | Description |
---|---|---|---|
args | [String ! ] ! | - | Arguments to pass to GitHub CLI. |
token | Secret | - | GitHub token. |
repo | String | - | GitHub repository (e.g. "owner/repo"). |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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)
}
terminal() 🔗
Open an interactive terminal.
Return Type
Terminal !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
token | Secret | - | GitHub token. |
repo | String | - | GitHub repository (e.g. "owner/repo"). |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f call \
terminal
func (m *myModule) example() *Terminal {
return dag.
Gh().
Terminal()
}
@function
def example() -> dag.Terminal:
return (
dag.gh()
.terminal()
)
@func()
example(): Terminal {
return dag
.gh()
.terminal()
}
release() 🔗
Manage releases.
Return Type
Release !
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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
Name | Type | Default Value | Description |
---|---|---|---|
repository | String ! | - | No description provided |
args | [String ! ] | - | Additional arguments to pass to the "git clone" command. |
token | Secret | - | GitHub token. |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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)
}
Release 🔗
create() 🔗
Create a new GitHub Release for a repository.
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
tag | String ! | - | Tag this release should point to or create. |
title | String ! | - | Release title. |
files | [File ! ] | - | Release assets to upload. |
draft | Boolean | - | Save the release as a draft instead of publishing it. |
preRelease | Boolean | - | Mark the release as a prerelease. |
target | String | - | Target branch or full commit SHA (default: main branch). |
notes | String | - | Release notes. |
notesFile | File | - | Read release notes from file. |
discussionCategory | String | - | Start a discussion in the specified category. |
generateNotes | Boolean | - | Automatically generate title and notes for the release. |
notesStartTag | String | - | Tag to use as the starting point for generating release notes. |
latest | Boolean | - | Mark this release as "Latest" (default: automatic based on date and version). |
verifyTag | Boolean | - | Abort in case the git tag doesn't already exist in the remote repository. |
notesFromTag | Boolean | - | Tag to use as the starting point for generating release notes. |
token | Secret | - | GitHub token. |
repo | String | - | GitHub repository (e.g. "owner/repo"). |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@52367e48ba10d4afb4c1187ff14d2f79d33c091f 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)
}