Include link to GitHub issues in issue response (#25178)
Release Notes: - N/A
This commit is contained in:
parent
ea40c1d9b3
commit
5f6d049751
1 changed files with 14 additions and 1 deletions
|
@ -7,6 +7,7 @@ import { IncomingWebhook } from "@slack/webhook";
|
||||||
* [Slack Docs](https://api.slack.com/reference/block-kit/blocks#section)
|
* [Slack Docs](https://api.slack.com/reference/block-kit/blocks#section)
|
||||||
*/
|
*/
|
||||||
const SECTION_BLOCK_TEXT_LIMIT = 3000;
|
const SECTION_BLOCK_TEXT_LIMIT = 3000;
|
||||||
|
const GITHUB_ISSUES_URL = "https://github.com/zed-industries/zed/issues";
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const octokit = new Octokit({
|
const octokit = new Octokit({
|
||||||
|
@ -42,8 +43,10 @@ async function main() {
|
||||||
...authorFilters,
|
...authorFilters,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const searchQuery = q.join("+");
|
||||||
|
|
||||||
const response = await octokit.rest.search.issuesAndPullRequests({
|
const response = await octokit.rest.search.issuesAndPullRequests({
|
||||||
q: q.join("+"),
|
q: searchQuery,
|
||||||
per_page: 100,
|
per_page: 100,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -93,6 +96,16 @@ async function main() {
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const issuesUrl = `${GITHUB_ISSUES_URL}?q=${encodeURIComponent(searchQuery)}`;
|
||||||
|
|
||||||
|
blocks.push({
|
||||||
|
type: "section",
|
||||||
|
text: {
|
||||||
|
type: "mrkdwn",
|
||||||
|
text: `<${issuesUrl}|View on GitHub>`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
await webhook.send({ blocks });
|
await webhook.send({ blocks });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue