Dagger
Search

github-publisher

This module allows you to commit and push content to a GitHub repository
using Dagger's pipeline capabilities.

Installation

dagger install github.com/tuannvm/blogenetes/github-publisher@9d76dc7bca216dc134543d714954a73bf01fd479

Entrypoint

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
NameTypeDefault ValueDescription
stringArgString !-No description provided
Example
dagger -m github.com/tuannvm/blogenetes/github-publisher@9d76dc7bca216dc134543d714954a73bf01fd479 call \
 container-echo --string-arg string
func (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
NameTypeDefault ValueDescription
directoryArgDirectory !-No description provided
patternString !-No description provided
Example
dagger -m github.com/tuannvm/blogenetes/github-publisher@9d76dc7bca216dc134543d714954a73bf01fd479 call \
 grep-dir --directory-arg DIR_PATH --pattern string
func (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
NameTypeDefault ValueDescription
contentDirectory !-No description provided
repoString !-No description provided
ownerString !-No description provided
branchString !-No description provided
pathString !-No description provided
messageString !-No description provided
githubTokenSecret !-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:MYSECRET
func (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)
}