import { WebClient } from "@slack/web-api";
type Slack = {
token: string;
};
export async function main(
message: string,
name: string,
channel: string,
slack: Slack,
) {
const web = new WebClient(slack.token);
const flow_id = Bun.env.WM_FLOW_JOB_ID;
const text = (message = `Flow [${flow_id}](${Bun.env
.WM_BASE_URL}/run/${flow_id}?workspace=${Bun.env
.WM_WORKSPACE}) had an error:\n${name}: ${message}`);
await web.chat.postMessage({
channel,
text,
});
return { message, flow_id };
}
Submitted by hugo989 6 days ago