Dagger
Search

gha

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/TomChv/dagger/modules/gha@400be219f5fda2c50f9cce9bc7a48c31467e5926

Entrypoint

Return Type
Gha !
Arguments
NameTypeDefault ValueDescription
jobDefaultsJob -No description provided
workflowDefaultsWorkflow -No description provided
Example
Function Gha.Constructor is not accessible from the gha module
Function Gha.Constructor is not accessible from the gha module
Function Gha.Constructor is not accessible from the gha module
Function Gha.Constructor is not accessible from the gha module

Types

Gha 🔗

workflows() 🔗

Return Type
[Workflow ! ] !
Example
Function Gha.workflows is not accessible from the gha module
Function Gha.workflows is not accessible from the gha module
Function Gha.workflows is not accessible from the gha module
Function Gha.workflows is not accessible from the gha module

withWorkflow() 🔗

Return Type
Gha !
Arguments
NameTypeDefault ValueDescription
workflowWorkflow !-No description provided
Example
Function Gha.withWorkflow is not accessible from the gha module
Function Gha.withWorkflow is not accessible from the gha module
Function Gha.withWorkflow is not accessible from the gha module
Function Gha.withWorkflow is not accessible from the gha module

workflow() 🔗

Add a workflow

Return Type
Workflow !
Arguments
NameTypeDefault ValueDescription
nameString !-

Workflow name

pullRequestConcurrencyString -

Configure this workflow’s concurrency for each PR. This is triggered when the workflow is scheduled concurrently on the same PR. - allow: all instances are allowed to run concurrently - queue: new instances are queued, and run sequentially - preempt: new instances run immediately, older ones are canceled Possible values: “allow”, “preempt”, “queue”

noDispatchBoolean -

Disable manual “dispatch” of this workflow

permissions[Enum ! ] -

Permissions to grant the workflow

onIssueCommentBoolean -

Run the workflow on any issue comment activity

onIssueCommentCreatedBoolean -No description provided
onIssueCommentEditedBoolean -No description provided
onIssueCommentDeletedBoolean -No description provided
onPullRequestBoolean -

Run the workflow on any pull request activity

onPullRequestBranches[String ! ] -No description provided
onPullRequestPaths[String ! ] -No description provided
onPullRequestAssignedBoolean -No description provided
onPullRequestUnassignedBoolean -No description provided
onPullRequestLabeledBoolean -No description provided
onPullRequestUnlabeledBoolean -No description provided
onPullRequestOpenedBoolean -No description provided
onPullRequestEditedBoolean -No description provided
onPullRequestClosedBoolean -No description provided
onPullRequestReopenedBoolean -No description provided
onPullRequestSynchronizeBoolean -No description provided
onPullRequestConvertedToDraftBoolean -No description provided
onPullRequestLockedBoolean -No description provided
onPullRequestUnlockedBoolean -No description provided
onPullRequestEnqueuedBoolean -No description provided
onPullRequestDequeuedBoolean -No description provided
onPullRequestMilestonedBoolean -No description provided
onPullRequestDemilestonedBoolean -No description provided
onPullRequestReadyForReviewBoolean -No description provided
onPullRequestReviewRequestedBoolean -No description provided
onPullRequestReviewRequestRemovedBoolean -No description provided
onPullRequestAutoMergeEnabledBoolean -No description provided
onPullRequestAutoMergeDisabledBoolean -No description provided
onPushBoolean -

Run the workflow on any git push

onPushTags[String ! ] -

Run the workflow on git push to the specified tags

onPushBranches[String ! ] -

Run the workflow on git push to the specified branches

onPushPaths[String ! ] -

Run the workflow only if the paths match

onSchedule[String ! ] -

Run the workflow at a schedule time

Example
Function Gha.workflow is not accessible from the gha module
Function Gha.workflow is not accessible from the gha module
Function Gha.workflow is not accessible from the gha module
Function Gha.workflow is not accessible from the gha module

generate() 🔗

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
directoryDirectory -No description provided
asJsonBoolean -No description provided
fileExtensionString ".gen.yml"No description provided
Example
Function Gha.generate is not accessible from the gha module
Function Gha.generate is not accessible from the gha module
Function Gha.generate is not accessible from the gha module
Function Gha.generate is not accessible from the gha module

job() 🔗

Return Type
Job !
Arguments
NameTypeDefault ValueDescription
nameString !-No description provided
commandString !-No description provided
conditionString -

Only run the job if this condition expression succeeds.

setupCommands[String ! ] -

Additional commands to run before the main one.

teardownCommands[String ! ] -

Additional commands to run after the main one.

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

stopEngineBoolean -

Explicitly stop the dagger engine after completing the workflow.

timeoutMinutesInteger -

The maximum number of minutes to run the workflow before killing the process

debugBoolean -

Run the workflow in debug mode

secrets[String ! ] -

Github secrets to inject into the workflow environment. For each secret, an env variable with the same name is created. Example: [“PROD_DEPLOY_TOKEN”, “PRIVATE_SSH_KEY”]

env[String ! ] -

Dagger secret URIs to load and assign as env variables. Example: [“OPENAI_API_KEY=op://CI/openai-api-key”]

runner[String ! ] -

Dispatch jobs to the given runner Example: [“ubuntu-latest”]

moduleString -

The Dagger module to load

daggerVersionString -

Dagger version to run this workflow

daggerDevString -

Dagger dev version to run this workflow.

uploadLogsBoolean -

Redirect logs to an artifact

Example
Function Gha.job is not accessible from the gha module
Function Gha.job is not accessible from the gha module
Function Gha.job is not accessible from the gha module
Function Gha.job is not accessible from the gha module

Workflow 🔗

name() 🔗

Return Type
String !
Example
Function GhaWorkflow.name is not accessible from the gha module
Function GhaWorkflow.name is not accessible from the gha module
Function GhaWorkflow.name is not accessible from the gha module
Function GhaWorkflow.name is not accessible from the gha module

jobs() 🔗

Return Type
[Job ! ] !
Example
Function GhaWorkflow.jobs is not accessible from the gha module
Function GhaWorkflow.jobs is not accessible from the gha module
Function GhaWorkflow.jobs is not accessible from the gha module
Function GhaWorkflow.jobs is not accessible from the gha module

withJob() 🔗

Return Type
Workflow !
Arguments
NameTypeDefault ValueDescription
jobJob !-No description provided
Example
Function GhaWorkflow.withJob is not accessible from the gha module
Function GhaWorkflow.withJob is not accessible from the gha module
Function GhaWorkflow.withJob is not accessible from the gha module
Function GhaWorkflow.withJob is not accessible from the gha module

check() 🔗

Check that the workflow is valid, in a best effort way

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
repoDirectory -No description provided
Example
Function GhaWorkflow.check is not accessible from the gha module
Function GhaWorkflow.check is not accessible from the gha module
Function GhaWorkflow.check is not accessible from the gha module
Function GhaWorkflow.check is not accessible from the gha module

Job 🔗

name() 🔗

Return Type
String !
Example
Function GhaJob.name is not accessible from the gha module
Function GhaJob.name is not accessible from the gha module
Function GhaJob.name is not accessible from the gha module
Function GhaJob.name is not accessible from the gha module

command() 🔗

Return Type
String !
Example
Function GhaJob.command is not accessible from the gha module
Function GhaJob.command is not accessible from the gha module
Function GhaJob.command is not accessible from the gha module
Function GhaJob.command is not accessible from the gha module

condition() 🔗

Make the job conditional on an expression

Return Type
String !
Example
Function GhaJob.condition is not accessible from the gha module
Function GhaJob.condition is not accessible from the gha module
Function GhaJob.condition is not accessible from the gha module
Function GhaJob.condition is not accessible from the gha module

setupCommands() 🔗

Additional commands to run before the main one

Return Type
[String ! ] !
Example
Function GhaJob.setupCommands is not accessible from the gha module
Function GhaJob.setupCommands is not accessible from the gha module
Function GhaJob.setupCommands is not accessible from the gha module
Function GhaJob.setupCommands is not accessible from the gha module

teardownCommands() 🔗

Additional commands to run after the main one

Return Type
[String ! ] !
Example
Function GhaJob.teardownCommands is not accessible from the gha module
Function GhaJob.teardownCommands is not accessible from the gha module
Function GhaJob.teardownCommands is not accessible from the gha module
Function GhaJob.teardownCommands is not accessible from the gha module

timeoutMinutes() 🔗

The maximum number of minutes to run the workflow before killing the process

Return Type
Integer !
Example
Function GhaJob.timeoutMinutes is not accessible from the gha module
Function GhaJob.timeoutMinutes is not accessible from the gha module
Function GhaJob.timeoutMinutes is not accessible from the gha module
Function GhaJob.timeoutMinutes is not accessible from the gha module

debug() 🔗

Run the workflow in debug mode

Return Type
Boolean !
Example
Function GhaJob.debug is not accessible from the gha module
Function GhaJob.debug is not accessible from the gha module
Function GhaJob.debug is not accessible from the gha module
Function GhaJob.debug is not accessible from the gha module

secrets() 🔗

Github secrets to inject into the workflow environment. For each secret, an env variable with the same name is created. Example: [“PROD_DEPLOY_TOKEN”, “PRIVATE_SSH_KEY”]

Return Type
[String ! ] !
Example
Function GhaJob.secrets is not accessible from the gha module
Function GhaJob.secrets is not accessible from the gha module
Function GhaJob.secrets is not accessible from the gha module
Function GhaJob.secrets is not accessible from the gha module

env() 🔗

Lines to append to .env. Example: [“OPENAI_API_KEY=op://CI/openai-api-key”]

Return Type
[String ! ] !
Example
Function GhaJob.env is not accessible from the gha module
Function GhaJob.env is not accessible from the gha module
Function GhaJob.env is not accessible from the gha module
Function GhaJob.env is not accessible from the gha module

runner() 🔗

Dispatch jobs to the given runner Example: [“ubuntu-latest”]

Return Type
[String ! ] !
Example
Function GhaJob.runner is not accessible from the gha module
Function GhaJob.runner is not accessible from the gha module
Function GhaJob.runner is not accessible from the gha module
Function GhaJob.runner is not accessible from the gha module

module() 🔗

The Dagger module to load

Return Type
String !
Example
Function GhaJob.module is not accessible from the gha module
Function GhaJob.module is not accessible from the gha module
Function GhaJob.module is not accessible from the gha module
Function GhaJob.module is not accessible from the gha module

daggerVersion() 🔗

Dagger version to run this workflow

Return Type
String !
Example
Function GhaJob.daggerVersion is not accessible from the gha module
Function GhaJob.daggerVersion is not accessible from the gha module
Function GhaJob.daggerVersion is not accessible from the gha module
Function GhaJob.daggerVersion is not accessible from the gha module

daggerDev() 🔗

Build the dagger engine from scratch.

Return Type
String !
Example
Function GhaJob.daggerDev is not accessible from the gha module
Function GhaJob.daggerDev is not accessible from the gha module
Function GhaJob.daggerDev is not accessible from the gha module
Function GhaJob.daggerDev is not accessible from the gha module

publicToken() 🔗

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

Return Type
String !
Example
Function GhaJob.publicToken is not accessible from the gha module
Function GhaJob.publicToken is not accessible from the gha module
Function GhaJob.publicToken is not accessible from the gha module
Function GhaJob.publicToken is not accessible from the gha module

uploadLogs() 🔗

Redirect logs to an artifact

Return Type
Boolean !
Example
Function GhaJob.uploadLogs is not accessible from the gha module
Function GhaJob.uploadLogs is not accessible from the gha module
Function GhaJob.uploadLogs is not accessible from the gha module
Function GhaJob.uploadLogs is not accessible from the gha module

stopEngine() 🔗

Explicitly stop the dagger engine after completing the workflow.

Return Type
Boolean !
Example
Function GhaJob.stopEngine is not accessible from the gha module
Function GhaJob.stopEngine is not accessible from the gha module
Function GhaJob.stopEngine is not accessible from the gha module
Function GhaJob.stopEngine is not accessible from the gha module