notify
No long description provided.
Installation
dagger install github.com/context-and-oss/cicd/src/notify@v5.1.5Entrypoint
Return Type
Notify Example
dagger -m github.com/context-and-oss/cicd/src/notify@e510ca0bff49e501bdb77cbdb6b12eb0bf10c447 call \
func (m *MyModule) Example() *dagger.Notify {
return dag.
Notify()
}@function
def example() -> dagger.Notify:
return (
dag.notify()
)@func()
example(): Notify {
return dag
.notify()
}Types
Notify 🔗
Notify is the Dagger module that renders a pipeline’s combined evidence as a Teams card, a GitHub pull-request comment or an Azure DevOps thread, and delivers it. Delivery is reported in an evidence envelope of its own and is never a gate: CLEAN delivered, SKIPPED not configured, ERROR attempted and lost, passed=true in all three.
ado() 🔗
Ado posts a pipeline status comment to an Azure DevOps pull request.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| summary | File ! | - | combined-evidence.json from cross-cutting/evidence. |
| pipelineName | String ! | - | Human-readable pipeline name (e.g. “precommit”, “commit”). |
| org | String ! | - | Azure DevOps organisation name (e.g. “my-company”). |
| project | String ! | - | Azure DevOps team project name (e.g. “payments”). |
| repoId | String ! | - | Repository name or GUID. |
| prId | Integer ! | - | Pull request ID (use $(System.PullRequest.PullRequestId) in ADO pipelines). |
| token | Secret ! | - | ADO access token or PAT. |
| runUrl | String | - | CI run URL shown as a link in the comment. |
Example
dagger -m github.com/context-and-oss/cicd/src/notify@e510ca0bff49e501bdb77cbdb6b12eb0bf10c447 call \
ado --summary file:path --pipeline-name string --org string --project string --repo-id string --pr-id integer --token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, summary *dagger.File, pipelineName string, org string, project string, repoId string, prId int, token *dagger.Secret) {
return dag.
Notify().
Ado(ctx, summary, pipelineName, org, project, repoId, prId, token)
}@function
async def example(summary: dagger.File, pipelinename: str, org: str, project: str, repoid: str, prid: int, token: dagger.Secret) -> None:
return await (
dag.notify()
.ado(summary, pipelinename, org, project, repoid, prid, token)
)@func()
async example(summary: File, pipelineName: string, org: string, project: string, repoId: string, prId: number, token: Secret): Promise<void> {
return dag
.notify()
.ado(summary, pipelineName, org, project, repoId, prId, token)
}adoBuildComment() 🔗
AdoBuildComment returns the formatted PR comment as a markdown file.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| summary | File ! | - | combined-evidence.json from cross-cutting/evidence. |
| pipelineName | String ! | - | Human-readable pipeline name. |
| runUrl | String | - | No description provided |
Example
dagger -m github.com/context-and-oss/cicd/src/notify@e510ca0bff49e501bdb77cbdb6b12eb0bf10c447 call \
ado-build-comment --summary file:path --pipeline-name stringfunc (m *MyModule) Example(summary *dagger.File, pipelineName string) *dagger.File {
return dag.
Notify().
Adobuildcomment(summary, pipelineName)
}@function
def example(summary: dagger.File, pipelinename: str) -> dagger.File:
return (
dag.notify()
.adobuildcomment(summary, pipelinename)
)@func()
example(summary: File, pipelineName: string): File {
return dag
.notify()
.adoBuildComment(summary, pipelineName)
}buildCard() 🔗
BuildCard assembles the Teams adaptive card from a combined-evidence.json and returns it as a JSON file. Useful for verifying card output without a real webhook endpoint.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| summary | File ! | - | combined-evidence.json file from cross-cutting/evidence. |
| pipelineName | String ! | - | Human-readable pipeline name (e.g. “precommit”, “commit”). |
| runUrl | String | - | CI pipeline run URL shown in the “View run” button. |
Example
dagger -m github.com/context-and-oss/cicd/src/notify@e510ca0bff49e501bdb77cbdb6b12eb0bf10c447 call \
build-card --summary file:path --pipeline-name stringfunc (m *MyModule) Example(summary *dagger.File, pipelineName string) *dagger.File {
return dag.
Notify().
Buildcard(summary, pipelineName)
}@function
def example(summary: dagger.File, pipelinename: str) -> dagger.File:
return (
dag.notify()
.buildcard(summary, pipelinename)
)@func()
example(summary: File, pipelineName: string): File {
return dag
.notify()
.buildCard(summary, pipelineName)
}github() 🔗
Github posts a pipeline status comment to a GitHub pull request.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| summary | File ! | - | combined-evidence.json from cross-cutting/evidence. |
| pipelineName | String ! | - | Human-readable pipeline name (e.g. “precommit”, “commit”). |
| repo | String ! | - | Full repository path: “owner/repo”. |
| prNumber | Integer ! | - | Pull request number. |
| token | Secret ! | - | GitHub token with repo write access. |
| runUrl | String | - | CI run URL shown as a link in the comment. |
Example
dagger -m github.com/context-and-oss/cicd/src/notify@e510ca0bff49e501bdb77cbdb6b12eb0bf10c447 call \
github --summary file:path --pipeline-name string --repo string --pr-number integer --token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, summary *dagger.File, pipelineName string, repo string, prNumber int, token *dagger.Secret) {
return dag.
Notify().
Github(ctx, summary, pipelineName, repo, prNumber, token)
}@function
async def example(summary: dagger.File, pipelinename: str, repo: str, prnumber: int, token: dagger.Secret) -> None:
return await (
dag.notify()
.github(summary, pipelinename, repo, prnumber, token)
)@func()
async example(summary: File, pipelineName: string, repo: string, prNumber: number, token: Secret): Promise<void> {
return dag
.notify()
.github(summary, pipelineName, repo, prNumber, token)
}githubBuildComment() 🔗
GithubBuildComment returns the formatted PR comment as a markdown file.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| summary | File ! | - | combined-evidence.json from cross-cutting/evidence. |
| pipelineName | String ! | - | Human-readable pipeline name. |
| runUrl | String | - | No description provided |
Example
dagger -m github.com/context-and-oss/cicd/src/notify@e510ca0bff49e501bdb77cbdb6b12eb0bf10c447 call \
github-build-comment --summary file:path --pipeline-name stringfunc (m *MyModule) Example(summary *dagger.File, pipelineName string) *dagger.File {
return dag.
Notify().
Githubbuildcomment(summary, pipelineName)
}@function
def example(summary: dagger.File, pipelinename: str) -> dagger.File:
return (
dag.notify()
.githubbuildcomment(summary, pipelinename)
)@func()
example(summary: File, pipelineName: string): File {
return dag
.notify()
.githubBuildComment(summary, pipelineName)
}teams() 🔗
Teams posts a pipeline status card to a Microsoft Teams channel via incoming webhook and returns an evidence envelope describing what happened to it.
It returns an envelope rather than a bare error because the three states a
notification can end in are not distinguishable from outside, and two of them
used to be invisible. A composite guarded the call with webhook != nil,
which is true for every consumer under GitHub Actions secrets: inherit or
Azure DevOps $(TEAMS_WEBHOOK) whether or not the secret exists, so cicd
POSTed to the empty string on every run of every repository that had not set
Teams up — and wrote unsupported protocol scheme "" to stderr, where it sat
for months inside a twenty-minute log while the run reported success. The
same treatment awaited a channel that was configured and whose webhook was
later rotated: green runs, no cards, one line nobody reads. A notifier that
could not notify must not report a delivered run.
Delivery never fails the pipeline (Passed is true in all three states — see teamsEvidence), and the returned file is the record. Errors returned here are cicd’s own faults, not the channel’s: evidence this module cannot read, or a secret the engine cannot resolve.
Laziness matters at the call site. A module function returning *dagger.File gets a generated client method with no ctx, so nothing in this body runs until something reads the file. A caller that drops the returned file sends no card at all.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| webhookUrl | Secret ! | - | Teams incoming webhook URL. |
| summary | File ! | - | combined-evidence.json file from cross-cutting/evidence. |
| pipelineName | String ! | - | Human-readable pipeline name (e.g. “precommit”, “commit”). |
| runUrl | String | - | CI pipeline run URL for the “View run” button. |
Example
dagger -m github.com/context-and-oss/cicd/src/notify@e510ca0bff49e501bdb77cbdb6b12eb0bf10c447 call \
teams --webhook-url env:MYSECRET --summary file:path --pipeline-name stringfunc (m *MyModule) Example(webhookUrl *dagger.Secret, summary *dagger.File, pipelineName string) *dagger.File {
return dag.
Notify().
Teams(webhookUrl, summary, pipelineName)
}@function
def example(webhookurl: dagger.Secret, summary: dagger.File, pipelinename: str) -> dagger.File:
return (
dag.notify()
.teams(webhookurl, summary, pipelinename)
)@func()
example(webhookUrl: Secret, summary: File, pipelineName: string): File {
return dag
.notify()
.teams(webhookUrl, summary, pipelineName)
}