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@b860484e277075d7cc393a9c706e38876f766a2dEntrypoint
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@b860484e277075d7cc393a9c706e38876f766a2d 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@b860484e277075d7cc393a9c706e38876f766a2d 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)
}