Dagger
Search

feature-branch

This module has been generated via dagger init and serves as a reference to
basic module structure as you get started with Dagger.

Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.

The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.

Installation

dagger install github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8

Entrypoint

Return Type
FeatureBranch !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-The Github Token to use
upstreamString !-The upstream repository to branch from
branchNameString !-The name of the branch to create
baseRefString -No description provided
forkNameString -No description provided
forkBoolean !falseShould the upstream repo be forked
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean
func (m *myModule) example(token *Secret, upstream string, branchName string, fork bool) *FeatureBranch  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork)
}
@function
def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool) -> dag.FeatureBranch:
	return (
		dag.feature_branch(token, upstream, branch_name, fork)
	)
@func()
example(token: Secret, upstream: string, branchName: string, fork: boolean): FeatureBranch {
	return dag
		.featureBranch(token, upstream, branchName, fork)
}

Types

FeatureBranch 🔗

Feature Branch module for GitHub development

githubToken() 🔗

GitHub Token

Return Type
Secret !
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean github-token
func (m *myModule) example(token *Secret, upstream string, branchName string, fork bool) *Secret  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork).
			GithubToken()
}
@function
def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool) -> dagger.Secret:
	return (
		dag.feature_branch(token, upstream, branch_name, fork)
		.github_token()
	)
@func()
example(token: Secret, upstream: string, branchName: string, fork: boolean): Secret {
	return dag
		.featureBranch(token, upstream, branchName, fork)
		.githubToken()
}

branch() 🔗

A git repo

Return Type
Directory !
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean branch
func (m *myModule) example(token *Secret, upstream string, branchName string, fork bool) *Directory  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork).
			Branch()
}
@function
def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool) -> dagger.Directory:
	return (
		dag.feature_branch(token, upstream, branch_name, fork)
		.branch()
	)
@func()
example(token: Secret, upstream: string, branchName: string, fork: boolean): Directory {
	return dag
		.featureBranch(token, upstream, branchName, fork)
		.branch()
}

diff() 🔗

Returns the diff of the branch

Return Type
String !
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean diff
func (m *myModule) example(ctx context.Context, token *Secret, upstream string, branchName string, fork bool) string  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork).
			Diff(ctx)
}
@function
async def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool) -> str:
	return await (
		dag.feature_branch(token, upstream, branch_name, fork)
		.diff()
	)
@func()
async example(token: Secret, upstream: string, branchName: string, fork: boolean): Promise<string> {
	return dag
		.featureBranch(token, upstream, branchName, fork)
		.diff()
}

env() 🔗

Returns a container with the necessary environment for git and gh

Return Type
Container !
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean env
func (m *myModule) example(token *Secret, upstream string, branchName string, fork bool) *Container  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork).
			Env()
}
@function
def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool) -> dagger.Container:
	return (
		dag.feature_branch(token, upstream, branch_name, fork)
		.env()
	)
@func()
example(token: Secret, upstream: string, branchName: string, fork: boolean): Container {
	return dag
		.featureBranch(token, upstream, branchName, fork)
		.env()
}

fork() 🔗

Sets the branch to a fork of a Github repository

Return Type
FeatureBranch !
Arguments
NameTypeDefault ValueDescription
upstreamString !-Upstream URL to fork
forkNameString -No description provided
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean fork --upstream string
func (m *myModule) example(token *Secret, upstream string, branchName string, fork bool, upstream1 string) *FeatureBranch  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork).
			Fork(upstream1)
}
@function
def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool, upstream1: str) -> dag.FeatureBranch:
	return (
		dag.feature_branch(token, upstream, branch_name, fork)
		.fork(upstream1)
	)
@func()
example(token: Secret, upstream: string, branchName: string, fork: boolean, upstream1: string): FeatureBranch {
	return dag
		.featureBranch(token, upstream, branchName, fork)
		.fork(upstream1)
}

getRemoteUrl() 🔗

Returns a remotes full url

Return Type
String !
Arguments
NameTypeDefault ValueDescription
remoteString !-The remote name to find the URL for
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean get-remote-url --remote string
func (m *myModule) example(ctx context.Context, token *Secret, upstream string, branchName string, fork bool, remote string) string  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork).
			GetRemoteUrl(ctx, remote)
}
@function
async def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool, remote: str) -> str:
	return await (
		dag.feature_branch(token, upstream, branch_name, fork)
		.get_remote_url(remote)
	)
@func()
async example(token: Secret, upstream: string, branchName: string, fork: boolean, remote: string): Promise<string> {
	return dag
		.featureBranch(token, upstream, branchName, fork)
		.getRemoteUrl(remote)
}

pullRequest() 🔗

Creates a pull request on the branch with the provided title and body

Return Type
String !
Arguments
NameTypeDefault ValueDescription
titleString !-The title of the pull request
bodyString !-The body of the pull request
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean pull-request --title string --body string
func (m *myModule) example(ctx context.Context, token *Secret, upstream string, branchName string, fork bool, title string, body string) string  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork).
			PullRequest(ctx, title, body)
}
@function
async def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool, title: str, body: str) -> str:
	return await (
		dag.feature_branch(token, upstream, branch_name, fork)
		.pull_request(title, body)
	)
@func()
async example(token: Secret, upstream: string, branchName: string, fork: boolean, title: string, body: string): Promise<string> {
	return dag
		.featureBranch(token, upstream, branchName, fork)
		.pullRequest(title, body)
}

push() 🔗

Pushes the branch to the remote

Return Type
String !
Arguments
NameTypeDefault ValueDescription
titleString !-The title of the commit
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean push --title string
func (m *myModule) example(ctx context.Context, token *Secret, upstream string, branchName string, fork bool, title string) string  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork).
			Push(ctx, title)
}
@function
async def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool, title: str) -> str:
	return await (
		dag.feature_branch(token, upstream, branch_name, fork)
		.push(title)
	)
@func()
async example(token: Secret, upstream: string, branchName: string, fork: boolean, title: string): Promise<string> {
	return dag
		.featureBranch(token, upstream, branchName, fork)
		.push(title)
}

withBranch() 🔗

Overwrites the branch

Return Type
FeatureBranch !
Arguments
NameTypeDefault ValueDescription
branchDirectory !-The git repo to use as the branch
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean with-branch --branch DIR_PATH
func (m *myModule) example(token *Secret, upstream string, branchName string, fork bool, branch *Directory) *FeatureBranch  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork).
			WithBranch(branch)
}
@function
def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool, branch: dagger.Directory) -> dag.FeatureBranch:
	return (
		dag.feature_branch(token, upstream, branch_name, fork)
		.with_branch(branch)
	)
@func()
example(token: Secret, upstream: string, branchName: string, fork: boolean, branch: Directory): FeatureBranch {
	return dag
		.featureBranch(token, upstream, branchName, fork)
		.withBranch(branch)
}

withBranchName() 🔗

Sets the branch name

Return Type
FeatureBranch !
Arguments
NameTypeDefault ValueDescription
branchNameString !-The name of the branch
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean with-branch-name --branch-name string
func (m *myModule) example(token *Secret, upstream string, branchName string, fork bool, branchName1 string) *FeatureBranch  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork).
			WithBranchName(branchName1)
}
@function
def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool, branch_name1: str) -> dag.FeatureBranch:
	return (
		dag.feature_branch(token, upstream, branch_name, fork)
		.with_branch_name(branch_name1)
	)
@func()
example(token: Secret, upstream: string, branchName: string, fork: boolean, branchName1: string): FeatureBranch {
	return dag
		.featureBranch(token, upstream, branchName, fork)
		.withBranchName(branchName1)
}

withChanges() 🔗

Apply a directory of changes to the branch

Return Type
FeatureBranch !
Arguments
NameTypeDefault ValueDescription
changesDirectory !-The file changes to apply to the feature branch
keepGitBoolean !falseKeep any .git directory in the changes
Example
dagger -m github.com/kpenfound/dag/feature-branch@c6809821f7133cc03bea4290fbe81212e25338c8 call \
 --token env:MYSECRET --upstream string --branch-name string --fork boolean with-changes --changes DIR_PATH --keep-git boolean
func (m *myModule) example(token *Secret, upstream string, branchName string, fork bool, changes *Directory, keepGit bool) *FeatureBranch  {
	return dag.
			FeatureBranch(token, upstream, branchName, fork).
			WithChanges(changes, keepGit)
}
@function
def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool, changes: dagger.Directory, keep_git: bool) -> dag.FeatureBranch:
	return (
		dag.feature_branch(token, upstream, branch_name, fork)
		.with_changes(changes, keep_git)
	)
@func()
example(token: Secret, upstream: string, branchName: string, fork: boolean, changes: Directory, keepGit: boolean): FeatureBranch {
	return dag
		.featureBranch(token, upstream, branchName, fork)
		.withChanges(changes, keepGit)
}