github-publisher
This module allows you to commit and push content to a GitHub repositoryusing Dagger's pipeline capabilities.
Installation
dagger install github.com/tuannvm/blogenetes/github-publisher@9d76dc7bca216dc134543d714954a73bf01fd479Entrypoint
Return Type
GithubPublisher Example
dagger -m github.com/tuannvm/blogenetes/github-publisher@9d76dc7bca216dc134543d714954a73bf01fd479 call \
func (m *MyModule) Example() *dagger.GithubPublisher {
return dag.
GithubPublisher()
}@function
def example() -> dagger.GithubPublisher:
return (
dag.github_publisher()
)@func()
example(): GithubPublisher {
return dag
.githubPublisher()
}Types
GithubPublisher 🔗
containerEcho() 🔗
Returns a container that echoes whatever string argument is provided
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| stringArg | String ! | - | No description provided |
Example
dagger -m github.com/tuannvm/blogenetes/github-publisher@9d76dc7bca216dc134543d714954a73bf01fd479 call \
container-echo --string-arg stringfunc (m *MyModule) Example(stringArg string) *dagger.Container {
return dag.
GithubPublisher().
ContainerEcho(stringArg)
}@function
def example(string_arg: str) -> dagger.Container:
return (
dag.github_publisher()
.container_echo(string_arg)
)@func()
example(stringArg: string): Container {
return dag
.githubPublisher()
.containerEcho(stringArg)
}grepDir() 🔗
Returns lines that match a pattern in the files of the provided Directory
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| directoryArg | Directory ! | - | No description provided |
| pattern | String ! | - | No description provided |
Example
dagger -m github.com/tuannvm/blogenetes/github-publisher@9d76dc7bca216dc134543d714954a73bf01fd479 call \
grep-dir --directory-arg DIR_PATH --pattern stringfunc (m *MyModule) Example(ctx context.Context, directoryArg *dagger.Directory, pattern string) string {
return dag.
GithubPublisher().
GrepDir(ctx, directoryArg, pattern)
}@function
async def example(directory_arg: dagger.Directory, pattern: str) -> str:
return await (
dag.github_publisher()
.grep_dir(directory_arg, pattern)
)@func()
async example(directoryArg: Directory, pattern: string): Promise<string> {
return dag
.githubPublisher()
.grepDir(directoryArg, pattern)
}publish() 🔗
Publish commits and pushes content to a GitHub repository
Parameters: - ctx: The context for the operation - content: The file or directory to publish - repo: The name of the GitHub repository - owner: The owner of the GitHub repository - branch: The branch to push to (defaults to “main”) - path: The path in the repository to publish to - message: The commit message - githubToken: The GitHub token with repository write access
Returns: - *dagger.Container: The container used for Git operations - error: Any error that occurred
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| content | Directory ! | - | No description provided |
| repo | String ! | - | No description provided |
| owner | String ! | - | No description provided |
| branch | String ! | - | No description provided |
| path | String ! | - | No description provided |
| message | String ! | - | No description provided |
| githubToken | Secret ! | - | No description provided |
Example
dagger -m github.com/tuannvm/blogenetes/github-publisher@9d76dc7bca216dc134543d714954a73bf01fd479 call \
publish --content DIR_PATH --repo string --owner string --branch string --path string --message string --github-token env:MYSECRETfunc (m *MyModule) Example(content *dagger.Directory, repo string, owner string, branch string, path string, message string, githubToken *dagger.Secret) *dagger.Container {
return dag.
GithubPublisher().
Publish(content, repo, owner, branch, path, message, githubToken)
}@function
def example(content: dagger.Directory, repo: str, owner: str, branch: str, path: str, message: str, github_token: dagger.Secret) -> dagger.Container:
return (
dag.github_publisher()
.publish(content, repo, owner, branch, path, message, github_token)
)@func()
example(content: Directory, repo: string, owner: string, branch: string, path: string, message: string, githubToken: Secret): Container {
return dag
.githubPublisher()
.publish(content, repo, owner, branch, path, message, githubToken)
}