From 70cd1bd351da9624f2e35c6bf78c8bb096abf578 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Wed, 11 Mar 2026 11:20:57 -0400 Subject: [PATCH] ci: allow bot bypass (#35762) --- .../workflows/tag-external-contributions.yml | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tag-external-contributions.yml b/.github/workflows/tag-external-contributions.yml index 362d2cfc8ca..59818b3082a 100644 --- a/.github/workflows/tag-external-contributions.yml +++ b/.github/workflows/tag-external-contributions.yml @@ -68,6 +68,15 @@ jobs: const { owner, repo } = context.repo; const author = context.payload.sender.login; + // GitHub App bots (e.g. model-profile-bot) are not org members + // but should be treated as internal — skip the membership check. + const senderType = context.payload.sender.type; + if (senderType === 'Bot') { + console.log(`Sender ${author} is a Bot — treating as internal`); + core.setOutput('is-external', 'false'); + return; + } + try { // Check if the author is a member of the langchain-ai organization // This requires org:read permissions to see private memberships @@ -267,9 +276,16 @@ jobs: // Cache: author -> { isExternal, mergedCount } const contributorCache = new Map(); - async function getContributorInfo(author) { + async function getContributorInfo(author, userType) { if (contributorCache.has(author)) return contributorCache.get(author); + // Bots are always internal + if (userType === 'Bot') { + const info = { isExternal: false, mergedCount: 0 }; + contributorCache.set(author, info); + return info; + } + let isExternal = true; try { const membership = await github.rest.orgs.getMembershipForUser({ @@ -341,7 +357,7 @@ jobs: for (const pr of prs) { if (processed >= maxItems) break; const author = pr.user.login; - const info = await getContributorInfo(author); + const info = await getContributorInfo(author, pr.user.type); const labels = []; labels.push(info.isExternal ? 'external' : 'internal'); @@ -383,7 +399,7 @@ jobs: if (issue.pull_request) continue; const author = issue.user.login; - const info = await getContributorInfo(author); + const info = await getContributorInfo(author, issue.user.type); const labels = []; labels.push(info.isExternal ? 'external' : 'internal');