Dagger
Search

github-api

This module has been generated via dagger init and serves as a reference to
basic 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/vikram-dagger/daggerverse/github-api@a8355f6353d62e0ec08868426538215b6250869b

Entrypoint

Return Type
GithubApi !
Example
dagger -m github.com/vikram-dagger/daggerverse/github-api@a8355f6353d62e0ec08868426538215b6250869b call \
func (m *MyModule) Example() *dagger.GithubApi  {
	return dag.
			GithubApi()
}
@function
def example() -> dagger.GithubApi:
	return (
		dag.github_api()
	)
@func()
example(): GithubApi {
	return dag
		.githubApi()
}

Types

GithubApi 🔗

createComment() 🔗

Adds a comment to the PR

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repositoryString !-The owner and repository name
refString !-The ref name
bodyString !-The comment body
tokenSecret !-GitHub API token
Example
dagger -m github.com/vikram-dagger/daggerverse/github-api@a8355f6353d62e0ec08868426538215b6250869b call \
 create-comment --repository string --ref string --body string --token env:MYSECRET
func (m *MyModule) Example(ctx context.Context, repository string, ref string, body string, token *dagger.Secret) string  {
	return dag.
			GithubApi().
			CreateComment(ctx, repository, ref, body, token)
}
@function
async def example(repository: str, ref: str, body: str, token: dagger.Secret) -> str:
	return await (
		dag.github_api()
		.create_comment(repository, ref, body, token)
	)
@func()
async example(repository: string, ref: string, body: string, token: Secret): Promise<string> {
	return dag
		.githubApi()
		.createComment(repository, ref, body, token)
}

createPr() 🔗

Creates a new PR with the changes

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repositoryString !-The owner and repository name
refString !-The ref name
diffFileFile !-The diff file
tokenSecret !-GitHub API token
Example
dagger -m github.com/vikram-dagger/daggerverse/github-api@a8355f6353d62e0ec08868426538215b6250869b call \
 create-pr --repository string --ref string --diff-file file:path --token env:MYSECRET
func (m *MyModule) Example(ctx context.Context, repository string, ref string, diffFile *dagger.File, token *dagger.Secret) string  {
	return dag.
			GithubApi().
			CreatePr(ctx, repository, ref, diffFile, token)
}
@function
async def example(repository: str, ref: str, diff_file: dagger.File, token: dagger.Secret) -> str:
	return await (
		dag.github_api()
		.create_pr(repository, ref, diff_file, token)
	)
@func()
async example(repository: string, ref: string, diffFile: File, token: Secret): Promise<string> {
	return dag
		.githubApi()
		.createPr(repository, ref, diffFile, token)
}