ghcontrib
This module provides functions to check that pull requests conform toproject 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@14eb2e28ca4d383239f9917e363a628a4a748f6bEntrypoint
Return Type
Ghcontrib !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| token | Secret ! | - | GitHub token. |
| repo | String ! | - | GitHub repository (e.g. "owner/repo"). |
Example
dagger -m github.com/papercomputeco/daggerverse/ghcontrib@14eb2e28ca4d383239f9917e363a628a4a748f6b call \
--token env:MYSECRET --repo stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| number | Integer ! | - | The pull request number to check |
Example
dagger -m github.com/papercomputeco/daggerverse/ghcontrib@14eb2e28ca4d383239f9917e363a628a4a748f6b call \
--token env:MYSECRET --repo string check-pull-request --number integerfunc (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)
}