gh
No long description provided.
Installation
dagger install github.com/adore-me/daggerverse/gh@35886761ca654018e24e43da11fa9c776d8bcaf8Entrypoint
Return Type
Gh !Arguments
| Name | Type | Default Value | Description | 
|---|---|---|---|
| owner | String ! | - | The owner of the repository (ex: adore-me) | 
| repo | String ! | - | The name of the repository (ex: daggerverse) | 
| baseBranch | String | "master" | The base branch of the repository (ex: main, master) | 
| token | Secret ! | - | The token to authenticate with GitHub | 
| repoPath | Directory ! | - | RepoDir of the GitHub repo. Usually the root directory of the workdir. | 
Example
dagger -m github.com/adore-me/daggerverse/gh@35886761ca654018e24e43da11fa9c776d8bcaf8 call \
 --owner string --repo string --token env:MYSECRET --repo-path DIR_PATHfunc (m *MyModule) Example(owner string, repo string, token *dagger.Secret, repoPath *dagger.Directory) *dagger.Gh  {
	return dag.
			Gh(owner, repo, token, repoPath)
}@function
def example(owner: str, repo: str, token: dagger.Secret, repo_path: dagger.Directory) -> dagger.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
| Name | Type | Default Value | Description | 
|---|---|---|---|
| branchName | String ! | - | The new branch name to create the pull request from | 
Example
dagger -m github.com/adore-me/daggerverse/gh@35886761ca654018e24e43da11fa9c776d8bcaf8 call \
 --owner string --repo string --token env:MYSECRET --repo-path DIR_PATH create-local-branch --branch-name stringfunc (m *MyModule) Example(ctx context.Context, owner string, repo string, token *dagger.Secret, repoPath *dagger.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
| Name | Type | Default Value | Description | 
|---|---|---|---|
| commitTitle | String | "Update file" | Title of the commit | 
| branchName | String ! | - | The new branch name to commit changes to | 
Example
dagger -m github.com/adore-me/daggerverse/gh@35886761ca654018e24e43da11fa9c776d8bcaf8 call \
 --owner string --repo string --token env:MYSECRET --repo-path DIR_PATH commit-changes-in-new-branch --branch-name stringfunc (m *MyModule) Example(ctx context.Context, owner string, repo string, token *dagger.Secret, repoPath *dagger.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
| Name | Type | Default Value | Description | 
|---|---|---|---|
| branch | String ! | - | The branch to update the file in | 
| filePath | String ! | - | The path to the file you want to update | 
Example
dagger -m github.com/adore-me/daggerverse/gh@35886761ca654018e24e43da11fa9c776d8bcaf8 call \
 --owner string --repo string --token env:MYSECRET --repo-path DIR_PATH get-file-from-remote --branch string --file-path stringfunc (m *MyModule) Example(ctx context.Context, owner string, repo string, token *dagger.Secret, repoPath *dagger.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
| Name | Type | Default Value | Description | 
|---|---|---|---|
| title | String ! | - | The title of the pull request | 
| newBranch | String ! | - | The new branch name to create the pull request from | 
| baseBranch | String | - | The base branch to create the pull request against | 
Example
dagger -m github.com/adore-me/daggerverse/gh@35886761ca654018e24e43da11fa9c776d8bcaf8 call \
 --owner string --repo string --token env:MYSECRET --repo-path DIR_PATH create-pull-request --title string --new-branch stringfunc (m *MyModule) Example(ctx context.Context, owner string, repo string, token *dagger.Secret, repoPath *dagger.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)
}