Dagger
Search

github

github: GitHub utilities for Dagger pipelines.

Installation

dagger install github.com/typesafe-ai/daggerverse/github@2fd25bcaa940c9c91d197aa61f635fe175144c78

Entrypoint

Return Type
Github !
Arguments
NameTypeDefault ValueDescription
githubApiString !"https://api.github.com"Base URL of the GitHub REST API.
Example
dagger -m github.com/typesafe-ai/daggerverse/github@2fd25bcaa940c9c91d197aa61f635fe175144c78 call \
 --github-api string
func (m *MyModule) Example(githubApi string) *dagger.Github  {
	return dag.
			Github(githubApi)
}
@function
def example(github_api: str) -> dagger.Github:
	return (
		dag.github(github_api)
	)
@func()
example(githubApi: string): Github {
	return dag
		.github(githubApi)
}

Types

StatusMonitor 🔗

githubApi() 🔗

Base URL of the GitHub REST API.

Return Type
String !
Example
dagger -m github.com/typesafe-ai/daggerverse/github@2fd25bcaa940c9c91d197aa61f635fe175144c78 call \
 status-monitor \
 github-api
func (m *MyModule) Example(ctx context.Context) string  {
	return dag.
			Github().
			StatusMonitor().
			GithubApi(ctx)
}
@function
async def example() -> str:
	return await (
		dag.github()
		.status_monitor()
		.github_api()
	)
@func()
async example(): Promise<string> {
	return dag
		.github()
		.statusMonitor()
		.githubApi()
}

waitForDaggerChecks() 🔗

Wait for every Dagger check in the current workspace to succeed.

The expected status set is enumerated via dag.current_workspace().checks() — Dagger check names are assumed to match the GitHub status context strings published by Dagger Cloud.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repoString !-

GitHub repo as ‘owner/name’

refString !-

Commit SHA to poll

tokenSecret !-

GitHub token with read access

pollIntervalInteger !3

Seconds between GitHub polls

progressIntervalInteger !30

Seconds between routine progress lines (terminal transitions are still printed live).

timeoutInteger !1800

Total wall-clock budget, seconds

discoveryTimeoutInteger !300

How long expected statuses may take to first appear, seconds

failFastBoolean !false

If True, raise as soon as any check fails. If False (default), wait for every check to reach a terminal state and then raise at the end if any failed.

Example
dagger -m github.com/typesafe-ai/daggerverse/github@2fd25bcaa940c9c91d197aa61f635fe175144c78 call \
 status-monitor \
 wait-for-dagger-checks --repo string --ref string --token env:MYSECRET --poll-interval integer --progress-interval integer --timeout integer --discovery-timeout integer --fail-fast boolean
func (m *MyModule) Example(ctx context.Context, repo string, ref string, token *dagger.Secret, pollInterval int, progressInterval int, timeout int, discoveryTimeout int, failFast bool) string  {
	return dag.
			Github().
			StatusMonitor().
			WaitForDaggerChecks(ctx, repo, ref, token, pollInterval, progressInterval, timeout, discoveryTimeout, failFast)
}
@function
async def example(repo: str, ref: str, token: dagger.Secret, poll_interval: int, progress_interval: int, timeout: int, discovery_timeout: int, fail_fast: bool) -> str:
	return await (
		dag.github()
		.status_monitor()
		.wait_for_dagger_checks(repo, ref, token, poll_interval, progress_interval, timeout, discovery_timeout, fail_fast)
	)
@func()
async example(repo: string, ref: string, token: Secret, pollInterval: number, progressInterval: number, timeout: number, discoveryTimeout: number, failFast: boolean): Promise<string> {
	return dag
		.github()
		.statusMonitor()
		.waitForDaggerChecks(repo, ref, token, pollInterval, progressInterval, timeout, discoveryTimeout, failFast)
}

waitForStatuses() 🔗

Wait until every status context in checks and every check-run in check_runs succeeds on ref.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repoString !-

GitHub repo as ‘owner/name’

refString !-

Commit SHA to poll

tokenSecret !-

GitHub token with read access

checks[String ! ] null

GitHub commit-status context names to wait for.

checkRuns[String ! ] null

GitHub Actions check-run names to wait for (emitted by jobs).

pollIntervalInteger !3

Seconds between GitHub polls

progressIntervalInteger !30

Seconds between routine progress lines (terminal transitions are still printed live).

timeoutInteger !1800

Total wall-clock budget, seconds

discoveryTimeoutInteger !300

How long expected statuses may take to first appear, seconds

failFastBoolean !false

If True, raise as soon as any check fails. If False (default), wait for every check to reach a terminal state and then raise at the end if any failed.

Example
dagger -m github.com/typesafe-ai/daggerverse/github@2fd25bcaa940c9c91d197aa61f635fe175144c78 call \
 status-monitor \
 wait-for-statuses --repo string --ref string --token env:MYSECRET --poll-interval integer --progress-interval integer --timeout integer --discovery-timeout integer --fail-fast boolean
func (m *MyModule) Example(ctx context.Context, repo string, ref string, token *dagger.Secret, pollInterval int, progressInterval int, timeout int, discoveryTimeout int, failFast bool) string  {
	return dag.
			Github().
			StatusMonitor().
			WaitForStatuses(ctx, repo, ref, token, pollInterval, progressInterval, timeout, discoveryTimeout, failFast)
}
@function
async def example(repo: str, ref: str, token: dagger.Secret, poll_interval: int, progress_interval: int, timeout: int, discovery_timeout: int, fail_fast: bool) -> str:
	return await (
		dag.github()
		.status_monitor()
		.wait_for_statuses(repo, ref, token, poll_interval, progress_interval, timeout, discovery_timeout, fail_fast)
	)
@func()
async example(repo: string, ref: string, token: Secret, pollInterval: number, progressInterval: number, timeout: number, discoveryTimeout: number, failFast: boolean): Promise<string> {
	return dag
		.github()
		.statusMonitor()
		.waitForStatuses(repo, ref, token, pollInterval, progressInterval, timeout, discoveryTimeout, failFast)
}

Github 🔗

githubApi() 🔗

Base URL of the GitHub REST API.

Return Type
String !
Example
dagger -m github.com/typesafe-ai/daggerverse/github@2fd25bcaa940c9c91d197aa61f635fe175144c78 call \
 --github-api string github-api
func (m *MyModule) Example(ctx context.Context, githubApi string) string  {
	return dag.
			Github(githubApi).
			GithubApi(ctx)
}
@function
async def example(github_api: str) -> str:
	return await (
		dag.github(github_api)
		.github_api()
	)
@func()
async example(githubApi: string): Promise<string> {
	return dag
		.github(githubApi)
		.githubApi()
}

statusMonitor() 🔗

Poll GitHub commit statuses and check runs until a final verdict is reached.

Return Type
StatusMonitor !
Example
dagger -m github.com/typesafe-ai/daggerverse/github@2fd25bcaa940c9c91d197aa61f635fe175144c78 call \
 --github-api string status-monitor
func (m *MyModule) Example(githubApi string) *dagger.GithubStatusMonitor  {
	return dag.
			Github(githubApi).
			StatusMonitor()
}
@function
def example(github_api: str) -> dagger.GithubStatusMonitor:
	return (
		dag.github(github_api)
		.status_monitor()
	)
@func()
example(githubApi: string): GithubStatusMonitor {
	return dag
		.github(githubApi)
		.statusMonitor()
}