Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

581 B
Raw Blame
import { WebClient } from '@slack/web-api';

import { render } from './markdown.js';

const { CHANNEL_ID, SLACK_BOT_TOKEN, COPILOT_RESULT, BRANCH_SHA, BRANCH_NAME } =
  process.env;

const { ok } = await new WebClient(SLACK_BOT_TOKEN).chat.postMessage({
  channel: CHANNEL_ID,
  text: `AFFiNE Copilot Test ${COPILOT_RESULT}`,
  blocks: render(
    `# AFFiNE Copilot Test ${COPILOT_RESULT}

- [${BRANCH_NAME?.replace('refs/heads/', '') || BRANCH_SHA}](https://github.com/toeverything/AFFiNE/commit/${BRANCH_SHA})
`
  ),
});

console.assert(ok, 'Failed to send a message to Slack');