Dagger
Search

dagger2gha

Daggerizing your CI makes your YAML configurations smaller, but they still exist,
and they're still a pain to maintain by hand.

This module aims to finish the job, by letting you generate your remaining
YAML configuration from a Dagger pipeline, written in your favorite language.

Installation

dagger install github.com/shykes/dagger2gha@v0.2.2

Entrypoint

Return Type
Dagger2Gha !
Arguments
NameTypeDescription
publicTokenString Public Dagger Cloud token, for open-source projects. DO NOT PASS YOUR PRIVATE DAGGER CLOUD TOKEN! This is for a special "public" token which can safely be shared publicly. To get one, contact support@dagger.io
daggerVersionString Dagger version to run in the Github Actions pipelines
Example
dagger -m github.com/shykes/dagger2gha@1cfbd3c2e88688dd2b6d6f7b398ad04196dcb23e call \
func (m *myModule) example() *Dagger2Gha  {
	return dag.
			Dagger2gha()
}
@function
def example() -> dag.Dagger2Gha:
	return (
		dag.dagger2gha()
	)
@func()
example(): Dagger2Gha {
	return dag
		.dagger2gha()
}

Types

Dagger2Gha 🔗

onPush() 🔗

Add a trigger to execute a Dagger pipeline on a git push

Return Type
Dagger2Gha !
Arguments
NameTypeDefault ValueDescription
commandString !-The Dagger command to execute Example 'build --source=.'
moduleString "."No description provided
branches[String ! ] -No description provided
tags[String ! ] -No description provided
Example
dagger -m github.com/shykes/dagger2gha@1cfbd3c2e88688dd2b6d6f7b398ad04196dcb23e call \
 on-push --command string
func (m *myModule) example(command string) *Dagger2Gha  {
	return dag.
			Dagger2gha().
			OnPush(command)
}
@function
def example(command: str) -> dag.Dagger2Gha:
	return (
		dag.dagger2gha()
		.on_push(command)
	)
@func()
example(command: string): Dagger2Gha {
	return dag
		.dagger2gha()
		.onPush(command)
}

onPullRequest() 🔗

Add a trigger to execute a Dagger pipeline on a pull request

Return Type
Dagger2Gha !
Arguments
NameTypeDefault ValueDescription
commandString !-The Dagger command to execute Example 'build --source=.'
moduleString "."No description provided
branches[String ! ] -No description provided
Example
dagger -m github.com/shykes/dagger2gha@1cfbd3c2e88688dd2b6d6f7b398ad04196dcb23e call \
 on-pull-request --command string
func (m *myModule) example(command string) *Dagger2Gha  {
	return dag.
			Dagger2gha().
			OnPullRequest(command)
}
@function
def example(command: str) -> dag.Dagger2Gha:
	return (
		dag.dagger2gha()
		.on_pull_request(command)
	)
@func()
example(command: string): Dagger2Gha {
	return dag
		.dagger2gha()
		.onPullRequest(command)
}

config() 🔗

Generate a github config directory, usable as an overlay on the repository root

Return Type
Directory !
Example
dagger -m github.com/shykes/dagger2gha@1cfbd3c2e88688dd2b6d6f7b398ad04196dcb23e call \
 config
func (m *myModule) example() *Directory  {
	return dag.
			Dagger2gha().
			Config()
}
@function
def example() -> dagger.Directory:
	return (
		dag.dagger2gha()
		.config()
	)
@func()
example(): Directory {
	return dag
		.dagger2gha()
		.config()
}