signoff
from the developer machine. THis helps to reduce CI timeby moving the CI back to the developer's machine.
This module requires a GitHub token to access the different
GitHub APIs.
Installation
dagger install github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9
Entrypoint
Return Type
Signoff !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
sources | Directory ! | - | The local directory containing the git clone to work on. |
token | Secret ! | - | The GitHub token to get access to the GitHub APIs |
checkName | String | "signoff" | Name of the check, default to 'signoff' |
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET
func (m *myModule) example(sources *dagger.Directory, token *dagger.Secret) *dagger.Signoff {
return dag.
Signoff(sources, token)
}
@function
def example(sources: dagger.Directory, token: dagger.Secret, ) -> dagger.Signoff:
return (
dag.signoff(sources, token)
)
@func()
example(sources: Directory, token: Secret, ): Signoff {
return dag
.signoff(sources, token)
}
Types
Signoff 🔗
container() 🔗
Container containing git and github cli tools
Return Type
Container !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET container
func (m *myModule) example(sources *dagger.Directory, token *dagger.Secret) *dagger.Container {
return dag.
Signoff(sources, token).
Container()
}
@function
def example(sources: dagger.Directory, token: dagger.Secret, ) -> dagger.Container:
return (
dag.signoff(sources, token)
.container()
)
@func()
example(sources: Directory, token: Secret, ): Container {
return dag
.signoff(sources, token)
.container()
}
checkName() 🔗
Name of the check, default to ‘signoff’
Return Type
String !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET check-name
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) string {
return dag.
Signoff(sources, token).
CheckName(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> str:
return await (
dag.signoff(sources, token)
.check_name()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<string> {
return dag
.signoff(sources, token)
.checkName()
}
isClean() 🔗
Check if the local directory is clean.
This means that the three following constraints are verified: - no uncommited changes - the local branch is tracking a remote one - all commits have already been pushed If one of those constraint is failing, the return error will contain the explanation.
Return Type
Void !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET is-clean
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) {
return dag.
Signoff(sources, token).
IsClean(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> None:
return await (
dag.signoff(sources, token)
.is_clean()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<void> {
return dag
.signoff(sources, token)
.isClean()
}
create() 🔗
Sign off the current commit.
This first ensures the repository is clean, then mark the status of the signoff check (or any other configured name) as success.
Return Type
Void !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET create
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) {
return dag.
Signoff(sources, token).
Create(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> None:
return await (
dag.signoff(sources, token)
.create()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<void> {
return dag
.signoff(sources, token)
.create()
}
install() 🔗
Install signoff requirement on the defined branch or on the default one
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
branch | String | - | Branch to install the signoff requirement. If not set, the default branch will be used |
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET install
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) {
return dag.
Signoff(sources, token).
Install(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> None:
return await (
dag.signoff(sources, token)
.install()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<void> {
return dag
.signoff(sources, token)
.install()
}
uninstall() 🔗
Uninstall signoff requirement on the defined branch or on the default one. This will delete all branch protection on the selected branch.
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
branch | String | - | Branch to uninstall the signoff requirement. If not set, the default branch will be used |
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET uninstall
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) {
return dag.
Signoff(sources, token).
Uninstall(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> None:
return await (
dag.signoff(sources, token)
.uninstall()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<void> {
return dag
.signoff(sources, token)
.uninstall()
}
sha() 🔗
Retrieve the commit SHA of the most recent commit.
Return Type
String !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET sha
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) string {
return dag.
Signoff(sources, token).
Sha(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> str:
return await (
dag.signoff(sources, token)
.sha()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<string> {
return dag
.signoff(sources, token)
.sha()
}
whoIs() 🔗
Get the username of the user who is currently authenticated
Return Type
String !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET who-is
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) string {
return dag.
Signoff(sources, token).
WhoIs(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> str:
return await (
dag.signoff(sources, token)
.who_is()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<string> {
return dag
.signoff(sources, token)
.whoIs()
}
pullRequest() 🔗
Get the pull request url of the current branch (to the default branch) if any
Return Type
String !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET pull-request
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) string {
return dag.
Signoff(sources, token).
PullRequest(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> str:
return await (
dag.signoff(sources, token)
.pull_request()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<string> {
return dag
.signoff(sources, token)
.pullRequest()
}
openPr() 🔗
Open a pull request for the current branch
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
verbose | Boolean | false | fill with verbose information |
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET open-pr
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) string {
return dag.
Signoff(sources, token).
OpenPr(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> str:
return await (
dag.signoff(sources, token)
.open_pr()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<string> {
return dag
.signoff(sources, token)
.openPr()
}
withExec() 🔗
Exec any command
Return Type
Signoff !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
args | [String ! ] ! | - | No description provided |
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET with-exec --args string1 --args string2
func (m *myModule) example(sources *dagger.Directory, token *dagger.Secret, args []string) *dagger.Signoff {
return dag.
Signoff(sources, token).
WithExec(args)
}
@function
def example(sources: dagger.Directory, token: dagger.Secret, args: List[str]) -> dagger.Signoff:
return (
dag.signoff(sources, token)
.with_exec(args)
)
@func()
example(sources: Directory, token: Secret, args: string[]): Signoff {
return dag
.signoff(sources, token)
.withExec(args)
}
withGitExec() 🔗
Exec any git command. ‘git’ will be automatically added to the arguments
Return Type
Signoff !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
args | [String ! ] ! | - | No description provided |
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET with-git-exec --args string1 --args string2
func (m *myModule) example(sources *dagger.Directory, token *dagger.Secret, args []string) *dagger.Signoff {
return dag.
Signoff(sources, token).
WithGitExec(args)
}
@function
def example(sources: dagger.Directory, token: dagger.Secret, args: List[str]) -> dagger.Signoff:
return (
dag.signoff(sources, token)
.with_git_exec(args)
)
@func()
example(sources: Directory, token: Secret, args: string[]): Signoff {
return dag
.signoff(sources, token)
.withGitExec(args)
}
withGhExec() 🔗
Exec any gh command. ‘gh’ will be automatically added to the arguments
Return Type
Signoff !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
args | [String ! ] ! | - | No description provided |
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET with-gh-exec --args string1 --args string2
func (m *myModule) example(sources *dagger.Directory, token *dagger.Secret, args []string) *dagger.Signoff {
return dag.
Signoff(sources, token).
WithGhExec(args)
}
@function
def example(sources: dagger.Directory, token: dagger.Secret, args: List[str]) -> dagger.Signoff:
return (
dag.signoff(sources, token)
.with_gh_exec(args)
)
@func()
example(sources: Directory, token: Secret, args: string[]): Signoff {
return dag
.signoff(sources, token)
.withGhExec(args)
}
terminal() 🔗
Open an interactive terminal into the container with git and gh tools
Return Type
Container !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET terminal
func (m *myModule) example(sources *dagger.Directory, token *dagger.Secret) *dagger.Container {
return dag.
Signoff(sources, token).
Terminal()
}
@function
def example(sources: dagger.Directory, token: dagger.Secret, ) -> dagger.Container:
return (
dag.signoff(sources, token)
.terminal()
)
@func()
example(sources: Directory, token: Secret, ): Container {
return dag
.signoff(sources, token)
.terminal()
}
out() 🔗
Return Type
String !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET out
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) string {
return dag.
Signoff(sources, token).
Out(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> str:
return await (
dag.signoff(sources, token)
.out()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<string> {
return dag
.signoff(sources, token)
.out()
}
stdout() 🔗
Return Type
String !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET stdout
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) string {
return dag.
Signoff(sources, token).
Stdout(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> str:
return await (
dag.signoff(sources, token)
.stdout()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<string> {
return dag
.signoff(sources, token)
.stdout()
}
exitCode() 🔗
Return Type
Integer !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET exit-code
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) int {
return dag.
Signoff(sources, token).
ExitCode(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> int:
return await (
dag.signoff(sources, token)
.exit_code()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<number> {
return dag
.signoff(sources, token)
.exitCode()
}
stderr() 🔗
Return Type
String !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET stderr
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) string {
return dag.
Signoff(sources, token).
Stderr(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> str:
return await (
dag.signoff(sources, token)
.stderr()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<string> {
return dag
.signoff(sources, token)
.stderr()
}
defaultBranch() 🔗
Get the default branch configured on the repository using gh API
Return Type
String !
Example
dagger -m github.com/eunomie/daggerverse/signoff@211dacb7c1651dc826a4fb5ccd897421fdf746a9 call \
--sources DIR_PATH --token env:MYSECRET default-branch
func (m *myModule) example(ctx context.Context, sources *dagger.Directory, token *dagger.Secret) string {
return dag.
Signoff(sources, token).
DefaultBranch(ctx)
}
@function
async def example(sources: dagger.Directory, token: dagger.Secret, ) -> str:
return await (
dag.signoff(sources, token)
.default_branch()
)
@func()
async example(sources: Directory, token: Secret, ): Promise<string> {
return dag
.signoff(sources, token)
.defaultBranch()
}