import { WebClient } from "https://deno.land/x/slack_web_api@1.0.0/mod.ts";
type Slack = {
token: string;
};
export async function main(channel: string, slack: Slack, approvers: string[]) {
const web = new WebClient(slack.token);
const jobUrl = new URL(
`/run/${Deno.env.get("WM_FLOW_JOB_ID")}`,
Deno.env.get("WM_BASE_URL"),
);
const text = `Flow job ${jobUrl} (${Deno.env.get(
"WM_FLOW_PATH",
)}) run by ${Deno.env.get("WM_USERNAME")} was approved by ${approvers.join(
", ",
)}`;
await web.chat.postMessage({
channel,
text,
});
}
Submitted by admin 479 days ago
import { WebClient } from "https://deno.land/x/slack_web_api@1.0.0/mod.ts";
type Slack = {
token: string;
};
export async function main(
channel: string,
slack: Slack,
approvers: string[],
) {
const web = new WebClient(slack.token);
const jobUrl = new URL(`/run/${Deno.env.get('WM_FLOW_JOB_ID')}`, Deno.env.get('WM_BASE_URL'));
const text = `Flow job ${jobUrl} (${Deno.env.get('WM_FLOW_PATH')}) run by ${Deno.env.get(
'WM_USERNAME',
)} was approved by ${approvers.join(', ')}`
await web.chat.postMessage({
channel,
text,
});
}
Submitted by admin 482 days ago
import { WebClient } from "https://deno.land/x/slack_web_api@1.0.0/mod.ts";
import type { Resource } from "https://deno.land/x/windmill@v1.85.0/mod.ts";
export async function main(
channel: string,
slack: Resource<"slack">,
approvers: string[],
) {
const web = new WebClient(slack.token);
const jobUrl = new URL(`/run/${Deno.env.get('WM_FLOW_JOB_ID')}`, Deno.env.get('WM_BASE_URL'));
const text = `Flow job ${jobUrl} (${Deno.env.get('WM_FLOW_PATH')}) run by ${Deno.env.get(
'WM_USERNAME',
)} was approved by ${approvers.join(', ')}`
await web.chat.postMessage({
channel,
text,
});
}
Submitted by adam186 610 days ago
import { WebClient } from "https://deno.land/x/slack_web_api@1.0.0/mod.ts";
import type { Resource } from "https://deno.land/x/windmill@v1.70.1/mod.ts";
export async function main(
channel: string,
slack: Resource<"slack">,
approvers: string[],
) {
const web = new WebClient(slack.token);
const jobUrl = new URL(`/run/${Deno.env.get('WM_FLOW_JOB_ID')}`, Deno.env.get('WM_BASE_URL'));
const text = `Flow job ${jobUrl} (${Deno.env.get('WM_FLOW_PATH')}) run by ${Deno.env.get(
'WM_USERNAME',
)} was approved by ${approvers.join(', ')}`
await web.chat.postMessage({
channel,
text,
});
}
Submitted by adam186 645 days ago
import { WebClient } from "https://deno.land/x/slack_web_api@1.0.0/mod.ts";
import type { Resource } from "https://deno.land/x/windmill@v1.24.1/mod.ts";
export async function main(
channel: string,
slack: Resource<"slack">,
approvers: string[],
) {
const web = new WebClient(slack.token);
const jobUrl = new URL(`/run/${Deno.env.get('WM_FLOW_JOB_ID')}`, Deno.env.get('WM_BASE_URL'));
const text = `Flow job ${jobUrl} (${Deno.env.get('WM_FLOW_PATH')}) run by ${Deno.env.get(
'WM_USERNAME',
)} was approved by ${approvers.join(', ')}`
await web.chat.postMessage({
channel,
text,
});
}
Submitted by mrl5 762 days ago