git-actions
The main focus is to work with a Git Repository by SSH authentication.The Git Actions module is used in following example repository: https://github.com/puzzle/dagger-module-gitops/
Installation
dagger install github.com/puzzle/dagger-module-git-actions/git-actions@v0.9.1
Entrypoint
Return Type
GitActions
Example
dagger -m github.com/puzzle/dagger-module-git-actions/git-actions@034f9e50c01cc5a2b13b81854a48e29ad8162b6a call \
func (m *myModule) example() *GitActions {
return dag.
GitActions()
}
@function
def example() -> dag.GitActions:
return (
dag.git_actions()
)
@func()
example(): GitActions {
return dag
.gitActions()
}
Types
GitActions 🔗
withRepository() 🔗
Configure Git repository access with ssh key
Return Type
GitActionsGitActionRepository !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
repoUrl | String ! | - | URL of the Git repository |
sshKey | File ! | - | SSH key with access credentials for the Git repository |
Example
dagger -m github.com/puzzle/dagger-module-git-actions/git-actions@034f9e50c01cc5a2b13b81854a48e29ad8162b6a call \
with-repository --repo-url string --ssh-key file:path
func (m *myModule) example(repoUrl string, sshKey *File) *GitActionsGitActionRepository {
return dag.
GitActions().
WithRepository(repoUrl, sshKey)
}
@function
def example(repo_url: str, ssh_key: dagger.File) -> dag.GitActionsGitActionRepository:
return (
dag.git_actions()
.with_repository(repo_url, ssh_key)
)
@func()
example(repoUrl: string, sshKey: File): GitActionsGitActionRepository {
return dag
.gitActions()
.withRepository(repoUrl, sshKey)
}
GitActionsGitActionRepository 🔗
repoUrl() 🔗
URL of the Git repository
Return Type
String !
Example
dagger -m github.com/puzzle/dagger-module-git-actions/git-actions@034f9e50c01cc5a2b13b81854a48e29ad8162b6a call \
with-repository --repo-url string --ssh-key file:path \
repo-url
func (m *myModule) example(ctx context.Context, repoUrl string, sshKey *File) string {
return dag.
GitActions().
WithRepository(repoUrl, sshKey).
RepoUrl(ctx)
}
@function
async def example(repo_url: str, ssh_key: dagger.File) -> str:
return await (
dag.git_actions()
.with_repository(repo_url, ssh_key)
.repo_url()
)
@func()
async example(repoUrl: string, sshKey: File): Promise<string> {
return dag
.gitActions()
.withRepository(repoUrl, sshKey)
.repoUrl()
}
sshKey() 🔗
SSH key with access credentials for the Git repository
Return Type
File !
Example
dagger -m github.com/puzzle/dagger-module-git-actions/git-actions@034f9e50c01cc5a2b13b81854a48e29ad8162b6a call \
with-repository --repo-url string --ssh-key file:path \
ssh-key
func (m *myModule) example(repoUrl string, sshKey *File) *File {
return dag.
GitActions().
WithRepository(repoUrl, sshKey).
SshKey()
}
@function
def example(repo_url: str, ssh_key: dagger.File) -> dagger.File:
return (
dag.git_actions()
.with_repository(repo_url, ssh_key)
.ssh_key()
)
@func()
example(repoUrl: string, sshKey: File): File {
return dag
.gitActions()
.withRepository(repoUrl, sshKey)
.sshKey()
}
cloneSsh() 🔗
Clone Git repository using the SSH Key.
Return Type
Directory !
Example
dagger -m github.com/puzzle/dagger-module-git-actions/git-actions@034f9e50c01cc5a2b13b81854a48e29ad8162b6a call \
with-repository --repo-url string --ssh-key file:path \
clone-ssh
func (m *myModule) example(repoUrl string, sshKey *File) *Directory {
return dag.
GitActions().
WithRepository(repoUrl, sshKey).
CloneSsh()
}
@function
def example(repo_url: str, ssh_key: dagger.File) -> dagger.Directory:
return (
dag.git_actions()
.with_repository(repo_url, ssh_key)
.clone_ssh()
)
@func()
example(repoUrl: string, sshKey: File): Directory {
return dag
.gitActions()
.withRepository(repoUrl, sshKey)
.cloneSsh()
}
push() 🔗
Commit local changes to the Git repository using the SSH Key.
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
dir | Directory ! | - | local dir with the Git repository and the changes |
prBranch | String | "main" | Git branch to push to. |
Example
dagger -m github.com/puzzle/dagger-module-git-actions/git-actions@034f9e50c01cc5a2b13b81854a48e29ad8162b6a call \
with-repository --repo-url string --ssh-key file:path \
push --dir DIR_PATH
func (m *myModule) example(ctx context.Context, repoUrl string, sshKey *File, dir *Directory) {
return dag.
GitActions().
WithRepository(repoUrl, sshKey).
Push(ctx, dir)
}
@function
async def example(repo_url: str, ssh_key: dagger.File, dir: dagger.Directory) -> None:
return await (
dag.git_actions()
.with_repository(repo_url, ssh_key)
.push(dir)
)
@func()
async example(repoUrl: string, sshKey: File, dir: Directory): Promise<void> {
return dag
.gitActions()
.withRepository(repoUrl, sshKey)
.push(dir)
}