codespace-manager
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/BCIT-LTC/daggerverse/codespace-manager@93af8e4d9de21befc1ac3b9bebdfe69b4cfb0e34
Entrypoint
Return Type
CodespaceManager !
Example
dagger -m github.com/BCIT-LTC/daggerverse/codespace-manager@93af8e4d9de21befc1ac3b9bebdfe69b4cfb0e34 call \
func (m *MyModule) Example() *dagger.CodespaceManager {
return dag.
CodespaceManager()
}
@function
def example() -> dagger.CodespaceManager:
return (
dag.codespace_manager()
)
@func()
example(): CodespaceManager {
return dag
.codespaceManager()
}
Types
CodespaceManager 🔗
createCodespacePullRequest() 🔗
Create a Codespace from a pull request. Check if the Codespace already exists, and if not, create a new one. Assumes there can only be one Codespace per pull request.
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory | - | Source directory |
token | Secret ! | - | Token for Codespace creation |
organization | String ! | - | Organization Name |
repoName | String ! | - | Repository Name |
branchName | String ! | - | Branch Name |
pullRequestNumber | Integer ! | - | Pull Request Number |
Example
dagger -m github.com/BCIT-LTC/daggerverse/codespace-manager@93af8e4d9de21befc1ac3b9bebdfe69b4cfb0e34 call \
create-codespace-pull-request --token env:MYSECRET --organization string --repo-name string --branch-name string --pull-request-number integer
func (m *MyModule) Example(ctx context.Context, token *dagger.Secret, organization string, repoName string, branchName string, pullRequestNumber int) {
return dag.
CodespaceManager().
CreateCodespacePullRequest(ctxtoken, organization, repoName, branchName, pullRequestNumber)
}
@function
async def example(token: dagger.Secret, organization: str, repo_name: str, branch_name: str, pull_request_number: int) -> None:
return await (
dag.codespace_manager()
.create_codespace_pull_request(token, organization, repo_name, branch_name, pull_request_number)
)
@func()
async example(token: Secret, organization: string, repoName: string, branchName: string, pullRequestNumber: number): Promise<void> {
return dag
.codespaceManager()
.createCodespacePullRequest(token, organization, repoName, branchName, pullRequestNumber)
}
deleteCodespaceOnPrClose() 🔗
Delete a Codespace when a pull request is closed.
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory | - | Source directory |
token | Secret ! | - | Token for Codespace creation |
organization | String ! | - | Organization Name |
repoName | String ! | - | Repository Name |
branchName | String ! | - | Branch Name |
pullRequestNumber | Integer ! | - | Pull Request Number |
Example
dagger -m github.com/BCIT-LTC/daggerverse/codespace-manager@93af8e4d9de21befc1ac3b9bebdfe69b4cfb0e34 call \
delete-codespace-on-pr-close --token env:MYSECRET --organization string --repo-name string --branch-name string --pull-request-number integer
func (m *MyModule) Example(ctx context.Context, token *dagger.Secret, organization string, repoName string, branchName string, pullRequestNumber int) {
return dag.
CodespaceManager().
DeleteCodespaceOnPrClose(ctxtoken, organization, repoName, branchName, pullRequestNumber)
}
@function
async def example(token: dagger.Secret, organization: str, repo_name: str, branch_name: str, pull_request_number: int) -> None:
return await (
dag.codespace_manager()
.delete_codespace_on_pr_close(token, organization, repo_name, branch_name, pull_request_number)
)
@func()
async example(token: Secret, organization: string, repoName: string, branchName: string, pullRequestNumber: number): Promise<void> {
return dag
.codespaceManager()
.deleteCodespaceOnPrClose(token, organization, repoName, branchName, pullRequestNumber)
}