Dagger
Search

ghcontrib

This module provides functions to check that pull requests conform to
project standards. It uses the GitHub CLI (gh) to inspect PR metadata
and validates titles, labels, and other properties.

Installation

dagger install github.com/papercomputeco/daggerverse/ghcontrib@ac3ba56dbb4137c2419a562b3bc70c2b28b64023

Entrypoint

Return Type
Ghcontrib !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-GitHub token.
repoString !-GitHub repository (e.g. "owner/repo").
Example
dagger -m github.com/papercomputeco/daggerverse/ghcontrib@ac3ba56dbb4137c2419a562b3bc70c2b28b64023 call \
 --token env:MYSECRET --repo string
func (m *MyModule) Example(token *dagger.Secret, repo string) *dagger.Ghcontrib  {
	return dag.
			Ghcontrib(token, repo)
}
@function
def example(token: dagger.Secret, repo: str) -> dagger.Ghcontrib:
	return (
		dag.ghcontrib(token, repo)
	)
@func()
example(token: Secret, repo: string): Ghcontrib {
	return dag
		.ghcontrib(token, repo)
}

Types

Ghcontrib 🔗

checkPullRequest() 🔗

CheckPullRequest validates that a pull request conforms to project standards. It checks that the PR title starts with one of the required prefixes.

This is intended to be called from a GitHub Actions workflow where the GitHub token and PR metadata are available.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
numberInteger !-The pull request number to check
Example
dagger -m github.com/papercomputeco/daggerverse/ghcontrib@ac3ba56dbb4137c2419a562b3bc70c2b28b64023 call \
 --token env:MYSECRET --repo string check-pull-request --number integer
func (m *MyModule) Example(ctx context.Context, token *dagger.Secret, repo string, number int) string  {
	return dag.
			Ghcontrib(token, repo).
			CheckPullRequest(ctx, number)
}
@function
async def example(token: dagger.Secret, repo: str, number: int) -> str:
	return await (
		dag.ghcontrib(token, repo)
		.check_pull_request(number)
	)
@func()
async example(token: Secret, repo: string, number: number): Promise<string> {
	return dag
		.ghcontrib(token, repo)
		.checkPullRequest(number)
}