Dagger
Search

gh

No long description provided.

Installation

dagger install github.com/adore-me/daggerverse/gh@e3f36136773582f1de87cda2846e6fd5cd040837

Entrypoint

Return Type
Gh !
Arguments
NameTypeDescription
ownerString !The owner of the repository (ex: adore-me)
repoString !The name of the repository (ex: daggerverse)
baseBranchString The base branch of the repository (ex: main, master)
tokenSecret !The token to authenticate with GitHub
repoPathDirectory !RepoDir of the GitHub repo. Usually the root directory of the workdir.
Example
func (m *myModule) example(owner string, repo string, token *Secret, repoPath *Directory) *Gh  {
	return dag.
			Gh(owner, repo, token, repoPath)
}
@function
def example(owner: str, repo: str, token: dagger.Secret, repo_path: dagger.Directory) -> dag.Gh:
	return (
		dag.gh(owner, repo, token, repo_path)
	)
@func()
example(owner: string, repo: string, token: Secret, repoPath: Directory): Gh {
	return dag
		.gh(owner, repo, token, repoPath)
}

Types

Gh 🔗

createLocalBranch() 🔗

CreateLocalBranch creates a new branch in the provided repository.

Example usage: dagger call –token=env:TOKEN –owner=adore-me –repo=daggerverse create-new-branch –branch=test-daggerverse –repo-path=/path/to/repo

Return Type
String !
Arguments
NameTypeDefault ValueDescription
branchNameString !-The new branch name to create the pull request from
Example
dagger -m github.com/adore-me/daggerverse/gh@e3f36136773582f1de87cda2846e6fd5cd040837 call \
 --owner string --repo string --token env:MYSECRET --repo-path DIR_PATH create-local-branch --branch-name string
func (m *myModule) example(ctx context.Context, owner string, repo string, token *Secret, repoPath *Directory, branchName string) string  {
	return dag.
			Gh(owner, repo, token, repoPath).
			CreateLocalBranch(ctx, branchName)
}
@function
async def example(owner: str, repo: str, token: dagger.Secret, repo_path: dagger.Directory, branch_name: str) -> str:
	return await (
		dag.gh(owner, repo, token, repo_path)
		.create_local_branch(branch_name)
	)
@func()
async example(owner: string, repo: string, token: Secret, repoPath: Directory, branchName: string): Promise<string> {
	return dag
		.gh(owner, repo, token, repoPath)
		.createLocalBranch(branchName)
}

commitChangesInNewBranch() 🔗

Return Type
String !
Arguments
NameTypeDefault ValueDescription
commitTitleString "Update file"Title of the commit
branchNameString !-The new branch name to commit changes to
Example
dagger -m github.com/adore-me/daggerverse/gh@e3f36136773582f1de87cda2846e6fd5cd040837 call \
 --owner string --repo string --token env:MYSECRET --repo-path DIR_PATH commit-changes-in-new-branch --branch-name string
func (m *myModule) example(ctx context.Context, owner string, repo string, token *Secret, repoPath *Directory, branchName string) string  {
	return dag.
			Gh(owner, repo, token, repoPath).
			CommitChangesInNewBranch(ctxbranchName)
}
@function
async def example(owner: str, repo: str, token: dagger.Secret, repo_path: dagger.Directory, branch_name: str) -> str:
	return await (
		dag.gh(owner, repo, token, repo_path)
		.commit_changes_in_new_branch(branch_name)
	)
@func()
async example(owner: string, repo: string, token: Secret, repoPath: Directory, branchName: string): Promise<string> {
	return dag
		.gh(owner, repo, token, repoPath)
		.commitChangesInNewBranch(branchName)
}

getFileFromRemote() 🔗

GetFileFromRemote retrieves the content of a file from remote repository and returns the content base64 encoded.

Example usage: dagger call –token=env:TOKEN –owner=adore-me –repo=daggerverse update-file –branch=main –file-path=README.md

Return Type
String !
Arguments
NameTypeDefault ValueDescription
branchString !-The branch to update the file in
filePathString !-The path to the file you want to update
Example
dagger -m github.com/adore-me/daggerverse/gh@e3f36136773582f1de87cda2846e6fd5cd040837 call \
 --owner string --repo string --token env:MYSECRET --repo-path DIR_PATH get-file-from-remote --branch string --file-path string
func (m *myModule) example(ctx context.Context, owner string, repo string, token *Secret, repoPath *Directory, branch string, filePath string) string  {
	return dag.
			Gh(owner, repo, token, repoPath).
			GetFileFromRemote(ctx, branch, filePath)
}
@function
async def example(owner: str, repo: str, token: dagger.Secret, repo_path: dagger.Directory, branch: str, file_path: str) -> str:
	return await (
		dag.gh(owner, repo, token, repo_path)
		.get_file_from_remote(branch, file_path)
	)
@func()
async example(owner: string, repo: string, token: Secret, repoPath: Directory, branch: string, filePath: string): Promise<string> {
	return dag
		.gh(owner, repo, token, repoPath)
		.getFileFromRemote(branch, filePath)
}

createPullRequest() 🔗

CreatePullRequest creates a new pull request in the provided repository.

Example usage: dagger call –token=env:TOKEN –owner=adore-me –repo=daggerverse create-pull-request –title=“New PR” –new-branch=test-daggerverse

Return Type
String !
Arguments
NameTypeDefault ValueDescription
titleString !-The title of the pull request
newBranchString !-The new branch name to create the pull request from
baseBranchString -The base branch to create the pull request against
Example
dagger -m github.com/adore-me/daggerverse/gh@e3f36136773582f1de87cda2846e6fd5cd040837 call \
 --owner string --repo string --token env:MYSECRET --repo-path DIR_PATH create-pull-request --title string --new-branch string
func (m *myModule) example(ctx context.Context, owner string, repo string, token *Secret, repoPath *Directory, title string, newBranch string) string  {
	return dag.
			Gh(owner, repo, token, repoPath).
			CreatePullRequest(ctx, title, newBranch)
}
@function
async def example(owner: str, repo: str, token: dagger.Secret, repo_path: dagger.Directory, title: str, new_branch: str) -> str:
	return await (
		dag.gh(owner, repo, token, repo_path)
		.create_pull_request(title, new_branch)
	)
@func()
async example(owner: string, repo: string, token: Secret, repoPath: Directory, title: string, newBranch: string): Promise<string> {
	return dag
		.gh(owner, repo, token, repoPath)
		.createPullRequest(title, newBranch)
}