Skip to content

Commit

Permalink
Sent 'text' attribute for slack postMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
rushi committed Sep 11, 2024
1 parent 121aa30 commit 2eaeffa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/cleanup.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ echo -e "\nRemoving all containers"
docker rm "$(docker ps -a -q)"

echo -e "\nRemoving all images"
docker image rm "$(docker images -a -q)"
docker image prune -a
3 changes: 3 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ docker stop $CONTAINER_NAME
echo -e "\n\033[32mStarting ${CONTAINER_NAME}\033[0m"
sleep 5
docker run --name $CONTAINER_NAME --rm -d -p 6000:6000 $IMAGE_NAME

# Wait a little to ensure the container has not exited
sleep 5
echo -e "\n$(docker ps -a)"

echo -e "\nRun 'docker logs -f ${CONTAINER_NAME}' to show logs\n"
8 changes: 5 additions & 3 deletions src/handlers/PipelineUpdateHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,15 @@ class PipelineUpdateHandler extends Handler {

const notification = await new PipelineFailedNotification(pipeline, user).toJSON();
const title = notification ? notification.attachments?.[0]?.pretext ?? "N/A" : "N/A";
await this.app.client.chat.postMessage({
const payload = {
token: config.get("slack.token"),
channel: user.id,
title,
...notification,
});
console.log(JSON.stringify(notification, null, 2));
};
const response = await this.app.client.chat.postMessage(payload);
console.log(JSON.stringify(payload, null, 2));
console.log(response);
}

async getChannelByEmail(email) {
Expand Down

0 comments on commit 2eaeffa

Please sign in to comment.