From 5b8f8c1e1482f84c17b5a23c81c6f8606f0fad4c Mon Sep 17 00:00:00 2001 From: root Date: Sat, 27 Dec 2025 12:34:11 +0800 Subject: [PATCH] Update src/github/validation/actor.ts --- src/github/validation/actor.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/github/validation/actor.ts b/src/github/validation/actor.ts index 2599254..8255da6 100644 --- a/src/github/validation/actor.ts +++ b/src/github/validation/actor.ts @@ -12,6 +12,16 @@ export async function checkHumanActor( octokit: Octokit, githubContext: ParsedGitHubContext, ) { + + if (process.env.OVERRIDE_BOT_USERNAMES){ + if (process.env.OVERRIDE_BOT_USERNAMES.split(",").includes(githubContext.actor)){ + return; + } + throw new Error( + `Workflow initiated by non-human actor: ${githubContext.actor}. Please add bot to OVERRIDE_BOT_USERNAMES`, + ); + } + // Fetch user information from GitHub API const { data: userData } = await octokit.users.getByUsername({ username: githubContext.actor,