Skip to content

Commit

Permalink
Merge pull request #18 from turbot/release/v0.2
Browse files Browse the repository at this point in the history
Release/v0.2
  • Loading branch information
bigdatasourav authored Feb 7, 2024
2 parents 77f243c + a614539 commit a70ea20
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## v0.2.0 [2024-02-07]

_What's new?_

- Added pipeline `get_channel_id`. ([#17](https://github.com/turbot/flowpipe-mod-slack/pull/17)).

_Bug fixes_

- Fixed the input parameters of the `test_post_message` pipeline. ([#17](https://github.com/turbot/flowpipe-mod-slack/pull/17))

## v0.1.0 [2023-12-14]

_What's new?_
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ Slack pipeline library for [Flowpipe](https://flowpipe.io), enabling seamless in

## Getting started

### Requirements

Docker daemon must be installed and running. Please see [Install Docker Engine](https://docs.docker.com/engine/install/) for more information.

### Installation

Download and install Flowpipe (https://flowpipe.io/downloads). Or use Brew:
Expand Down Expand Up @@ -100,7 +96,7 @@ flowpipe pipeline list
Run a pipeline:

```shell
flowpipe pipeline run post_message -arg channel=test -arg text="Hello World"
flowpipe pipeline run post_message --arg channel=test --arg text="Hello World"
```

To use a specific `credential`, specify the `cred` pipeline argument:
Expand Down
23 changes: 23 additions & 0 deletions pipelines/channel/get_channel_id.fp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pipeline "get_channel_id" {
title = "Get Channel ID"
description = "Get the ID from the channel name."

param "cred" {
type = string
description = local.cred_param_description
default = "default"
}

param "channel_name" {
type = string
description = "Name of the channel."
}

step "pipeline" "list_channels" {
pipeline = pipeline.list_channels
}

output "channel_id" {
value = [for channel in step.pipeline.list_channels.output.channels : channel.id if channel.name == param.channel_name][0]
}
}
15 changes: 11 additions & 4 deletions pipelines/chat/tests/test_post_message.fp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// usage: flowpipe pipeline run test_post_message --pipeline-arg message="Hello World"
// usage: flowpipe pipeline run test_post_message --arg text="Hello from test_post_message" --arg channel="random"
pipeline "test_post_message" {
title = "Test Post Message"
description = "Test the post_message pipeline."
Expand All @@ -9,7 +9,7 @@ pipeline "test_post_message" {
default = "default"
}

param "message" {
param "text" {
type = string
default = "Hello World from test_post_message pipeline."
description = "The formatted text of the message to be published."
Expand All @@ -25,7 +25,14 @@ pipeline "test_post_message" {
args = {
cred = param.cred
channel = param.channel
message = param.message
text = param.text
}
}

step "pipeline" "get_channel_id" {
pipeline = pipeline.get_channel_id
args = {
channel_name = param.channel
}
}

Expand All @@ -34,7 +41,7 @@ pipeline "test_post_message" {
pipeline = pipeline.delete_message
args = {
cred = param.cred
channel = param.channel
channel = step.pipeline.get_channel_id.output.channel_id
ts = step.pipeline.post_message.output.message.ts
}
}
Expand Down

0 comments on commit a70ea20

Please sign in to comment.