gh
GitHub CLI
Installation
dagger install github.com/sagikazarmark/daggerverse/gh@v0.1.0
Entrypoint
Return Type
Gh !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String | - | GitHub CLI version. (default: latest version) |
token | Secret | - | GitHub token. |
repo | String | - | GitHub repository (e.g. "owner/repo"). |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@a7addb5a2ae6cef541a75072238df99e14e0e0af 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 🔗
release() 🔗
Manage releases.
Return Type
Release !
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@a7addb5a2ae6cef541a75072238df99e14e0e0af 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()
}
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@a7addb5a2ae6cef541a75072238df99e14e0e0af 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@a7addb5a2ae6cef541a75072238df99e14e0e0af 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)
}
get() 🔗
Get the GitHub CLI binary.
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String | - | GitHub CLI version. (default: latest version) |
token | Secret | - | GitHub token. (May be used to get the latest version from the GitHub API) |
Example
dagger -m github.com/sagikazarmark/daggerverse/gh@a7addb5a2ae6cef541a75072238df99e14e0e0af call \
get
func (m *myModule) example() *File {
return dag.
Gh().
Get()
}
@function
def example() -> dagger.File:
return (
dag.gh()
.get()
)
@func()
example(): File {
return dag
.gh()
.get()
}
Release 🔗
create() 🔗
Create a new GitHub Release for a repository.
Return Type
Container !
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@a7addb5a2ae6cef541a75072238df99e14e0e0af call \
release \
create --tag string --title string
func (m *myModule) example(tag string, title string) *Container {
return dag.
Gh().
Release().
Create(tag, title)
}
@function
def example(tag: str, title: str) -> dagger.Container:
return (
dag.gh()
.release()
.create(tag, title)
)
@func()
example(tag: string, title: string): Container {
return dag
.gh()
.release()
.create(tag, title)
}