Dagger
Search

notify

No long description provided.

Installation

dagger install github.com/context-and-oss/cicd/src/notify@v5.1.5

Entrypoint

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
NameTypeDefault ValueDescription
summaryFile !-

combined-evidence.json from cross-cutting/evidence.

pipelineNameString !-

Human-readable pipeline name (e.g. “precommit”, “commit”).

orgString !-

Azure DevOps organisation name (e.g. “my-company”).

projectString !-

Azure DevOps team project name (e.g. “payments”).

repoIdString !-

Repository name or GUID.

prIdInteger !-

Pull request ID (use $(System.PullRequest.PullRequestId) in ADO pipelines).

tokenSecret !-

ADO access token or PAT.

runUrlString -

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:MYSECRET
func (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
NameTypeDefault ValueDescription
summaryFile !-

combined-evidence.json from cross-cutting/evidence.

pipelineNameString !-

Human-readable pipeline name.

runUrlString -No description provided
Example
dagger -m github.com/context-and-oss/cicd/src/notify@e510ca0bff49e501bdb77cbdb6b12eb0bf10c447 call \
 ado-build-comment --summary file:path --pipeline-name string
func (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
NameTypeDefault ValueDescription
summaryFile !-

combined-evidence.json file from cross-cutting/evidence.

pipelineNameString !-

Human-readable pipeline name (e.g. “precommit”, “commit”).

runUrlString -

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 string
func (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
NameTypeDefault ValueDescription
summaryFile !-

combined-evidence.json from cross-cutting/evidence.

pipelineNameString !-

Human-readable pipeline name (e.g. “precommit”, “commit”).

repoString !-

Full repository path: “owner/repo”.

prNumberInteger !-

Pull request number.

tokenSecret !-

GitHub token with repo write access.

runUrlString -

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:MYSECRET
func (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
NameTypeDefault ValueDescription
summaryFile !-

combined-evidence.json from cross-cutting/evidence.

pipelineNameString !-

Human-readable pipeline name.

runUrlString -No description provided
Example
dagger -m github.com/context-and-oss/cicd/src/notify@e510ca0bff49e501bdb77cbdb6b12eb0bf10c447 call \
 github-build-comment --summary file:path --pipeline-name string
func (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
NameTypeDefault ValueDescription
webhookUrlSecret !-

Teams incoming webhook URL.

summaryFile !-

combined-evidence.json file from cross-cutting/evidence.

pipelineNameString !-

Human-readable pipeline name (e.g. “precommit”, “commit”).

runUrlString -

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 string
func (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)
}