From 94c45d7ea3821b2d863b7873b81d40c6eb90a05c Mon Sep 17 00:00:00 2001 From: DarkSky Date: Fri, 13 Dec 2024 17:20:15 +0800 Subject: [PATCH] feat: add more detail for slack report --- tools/copilot-result/index.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/copilot-result/index.js b/tools/copilot-result/index.js index 77d8e26bcc..c25501448d 100644 --- a/tools/copilot-result/index.js +++ b/tools/copilot-result/index.js @@ -2,8 +2,16 @@ 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 { + CHANNEL_ID, + SLACK_BOT_TOKEN, + COPILOT_RESULT, + BRANCH_SHA, + BRANCH_NAME, + GITHUB_SERVER_URL, + GITHUB_REPOSITORY, + GITHUB_RUN_ID, +} = process.env; const { ok } = await new WebClient(SLACK_BOT_TOKEN).chat.postMessage({ channel: CHANNEL_ID, @@ -11,7 +19,8 @@ const { ok } = await new WebClient(SLACK_BOT_TOKEN).chat.postMessage({ blocks: render( `# AFFiNE Copilot Test ${COPILOT_RESULT} -- [${BRANCH_NAME?.replace('refs/heads/', '') || BRANCH_SHA}](https://github.com/toeverything/AFFiNE/commit/${BRANCH_SHA}) +- Branch: [${BRANCH_NAME?.replace('refs/heads/', '') || BRANCH_SHA}](https://github.com/toeverything/AFFiNE/commit/${BRANCH_SHA}) +- Job: [${GITHUB_RUN_ID}](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}) ` ), });