-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb722c2
commit 68e9edf
Showing
5 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Send Teams Message | ||
|
||
Send a new chat message in the specified channel. | ||
|
||
## Usage | ||
|
||
- Add your Teams Access token and ID to `flowpipe.pvars` | ||
- Run the pipeline and specify the `channel_id` and `message` args, e.g., `flowpipe pipeline run send_teams_message --arg 'channel_id=944a8e14-7a6f-48c6-8805-6e93612f' --arg 'message=Hello world!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
access_token="<Acess Token>" | ||
team_id="<Team ID>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
mod "send_teams_message" { | ||
title = "Send Teams Message" | ||
description = "Send a new chat message in the specified channel." | ||
|
||
require { | ||
mod "github.com/turbot/flowpipe-mod-teams" { | ||
version = "v0.0.1-rc.10" | ||
args = { | ||
access_token = var.access_token | ||
team_id = var.team_id | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
pipeline "send_teams_message" { | ||
title = "Send Teams Message" | ||
description = "Send a new chat message in the specified channel." | ||
|
||
param "access_token" { | ||
type = string | ||
description = "The Microsoft personal security access token to authenticate to the Microsoft graph APIs." | ||
default = var.access_token | ||
} | ||
|
||
param "team_id" { | ||
type = string | ||
description = "The unique identifier of the team." | ||
default = var.team_id | ||
} | ||
|
||
param "channel_id" { | ||
type = string | ||
description = "The channel's unique identifier." | ||
} | ||
|
||
param "message" { | ||
type = string | ||
description = "The message to send." | ||
} | ||
|
||
param "message_content_type" { | ||
type = string | ||
description = "The type of the content. Possible values are text and html." | ||
optional = true | ||
default = "text" | ||
} | ||
|
||
step "pipeline" "send_teams_message" { | ||
pipeline = teams.pipeline.send_channel_message | ||
args = { | ||
access_token = param.access_token | ||
team_id = param.team_id | ||
channel_id = param.channel_id | ||
message = param.message | ||
message_content_type = param.message_content_type | ||
} | ||
} | ||
|
||
output "message" { | ||
value = step.pipeline.send_teams_message | ||
description = "Channel message details." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
variable "access_token" { | ||
description = "The Microsoft personal security access token to authenticate to the Microsoft graph APIs." | ||
type = string | ||
} | ||
|
||
variable "team_id" { | ||
description = "The unique identifier of the team." | ||
type = string | ||
} |