feature-branch
This module has been generated via dagger init and serves as a reference tobasic 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@273ca2c743001ca8b8f8468059469d63888cb9fdEntrypoint
Return Type
FeatureBranch !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| token | Secret ! | - | The Github Token to use |
| upstream | String ! | - | The upstream repository to branch from |
| branchName | String ! | - | The name of the branch to create |
| baseRef | String | - | No description provided |
| forkName | String | - | No description provided |
| fork | Boolean ! | false | Should the upstream repo be forked |
Example
dagger -m github.com/kpenfound/dag/feature-branch@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork booleanfunc (m *MyModule) Example(token *dagger.Secret, upstream string, branchName string, fork bool) *dagger.FeatureBranch {
return dag.
FeatureBranch(token, upstream, branchName, fork)
}@function
def example(token: dagger.Secret, upstream: str, branch_name: str, fork: bool) -> dagger.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@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork boolean github-tokenfunc (m *MyModule) Example(token *dagger.Secret, upstream string, branchName string, fork bool) *dagger.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@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork boolean branchfunc (m *MyModule) Example(token *dagger.Secret, upstream string, branchName string, fork bool) *dagger.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@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork boolean difffunc (m *MyModule) Example(ctx context.Context, token *dagger.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@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork boolean envfunc (m *MyModule) Example(token *dagger.Secret, upstream string, branchName string, fork bool) *dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| upstream | String ! | - | Upstream URL to fork |
| forkName | String | - | No description provided |
Example
dagger -m github.com/kpenfound/dag/feature-branch@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork boolean fork --upstream stringfunc (m *MyModule) Example(token *dagger.Secret, upstream string, branchName string, fork bool, upstream1 string) *dagger.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) -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| remote | String ! | - | The remote name to find the URL for |
Example
dagger -m github.com/kpenfound/dag/feature-branch@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork boolean get-remote-url --remote stringfunc (m *MyModule) Example(ctx context.Context, token *dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| title | String ! | - | The title of the pull request |
| body | String ! | - | The body of the pull request |
Example
dagger -m github.com/kpenfound/dag/feature-branch@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork boolean pull-request --title string --body stringfunc (m *MyModule) Example(ctx context.Context, token *dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| title | String ! | - | The title of the commit |
Example
dagger -m github.com/kpenfound/dag/feature-branch@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork boolean push --title stringfunc (m *MyModule) Example(ctx context.Context, token *dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| branch | Directory ! | - | The git repo to use as the branch |
Example
dagger -m github.com/kpenfound/dag/feature-branch@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork boolean with-branch --branch DIR_PATHfunc (m *MyModule) Example(token *dagger.Secret, upstream string, branchName string, fork bool, branch *dagger.Directory) *dagger.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) -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| branchName | String ! | - | The name of the branch |
Example
dagger -m github.com/kpenfound/dag/feature-branch@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork boolean with-branch-name --branch-name stringfunc (m *MyModule) Example(token *dagger.Secret, upstream string, branchName string, fork bool, branchName1 string) *dagger.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) -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| changes | Directory ! | - | The file changes to apply to the feature branch |
| keepGit | Boolean ! | false | Keep any .git directory in the changes |
Example
dagger -m github.com/kpenfound/dag/feature-branch@273ca2c743001ca8b8f8468059469d63888cb9fd call \
--token env:MYSECRET --upstream string --branch-name string --fork boolean with-changes --changes DIR_PATH --keep-git booleanfunc (m *MyModule) Example(token *dagger.Secret, upstream string, branchName string, fork bool, changes *dagger.Directory, keepGit bool) *dagger.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) -> dagger.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)
}