From 07eec083b9b4a2833892d893891cd015ab283eb4 Mon Sep 17 00:00:00 2001 From: Yiran Date: Thu, 26 Jun 2025 17:18:47 +0800 Subject: [PATCH] fix: doc issue assignee (#6406) Signed-off-by: Yiran --- cyborg/bin/follow-up-docs-issue.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cyborg/bin/follow-up-docs-issue.ts b/cyborg/bin/follow-up-docs-issue.ts index e08bfee083..acca21fe93 100644 --- a/cyborg/bin/follow-up-docs-issue.ts +++ b/cyborg/bin/follow-up-docs-issue.ts @@ -55,12 +55,25 @@ async function main() { await client.rest.issues.addLabels({ owner, repo, issue_number: number, labels: [labelDocsRequired], }) + + // Get available assignees for the docs repo + const assigneesResponse = await docsClient.rest.issues.listAssignees({ + owner: 'GreptimeTeam', + repo: 'docs', + }) + const validAssignees = assigneesResponse.data.map(assignee => assignee.login) + core.info(`Available assignees: ${validAssignees.join(', ')}`) + + // Check if the actor is a valid assignee, otherwise fallback to fengjiachun + const assignee = validAssignees.includes(actor) ? actor : 'fengjiachun' + core.info(`Assigning issue to: ${assignee}`) + await docsClient.rest.issues.create({ owner: 'GreptimeTeam', repo: 'docs', title: `Update docs for ${title}`, body: `A document change request is generated from ${html_url}`, - assignee: actor, + assignee: assignee, }).then((res) => { core.info(`Created issue ${res.data}`) })