From ad1251b9d9a323141ed720522e8a2182cab01734 Mon Sep 17 00:00:00 2001 From: Lena <241371603+zelenenka@users.noreply.github.com> Date: Mon, 12 Jan 2026 11:08:16 +0100 Subject: [PATCH] First-contribution autolabeler: work around a bug (#46603) The job was skipping first-time contributors because GitHub was returning None as their association. Release Notes: - N/A --- .github/workflows/first_contribution_labeler.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/first_contribution_labeler.yml b/.github/workflows/first_contribution_labeler.yml index 5a55bea31727ee5b4a09e7e75b6985c3768ff438..5dc47c4eef5cde084fc89de6aee85bb416ed1532 100644 --- a/.github/workflows/first_contribution_labeler.yml +++ b/.github/workflows/first_contribution_labeler.yml @@ -37,12 +37,14 @@ jobs: } // Check if this is a first-time contributor. - // These two values are mutually exclusive, so we need to check both: - // - FIRST_TIME_CONTRIBUTOR: has contributed to other repos, but not this one - // - FIRST_TIMER: has never contributed to any public repository on GitHub + // We use inverted logic here due to a suspected GitHub bug where first-time contributors + // get 'NONE' instead of 'FIRST_TIME_CONTRIBUTOR' or 'FIRST_TIMER'. + // https://github.com/orgs/community/discussions/78038 + // This will break if GitHub ever adds new associations. const association = pr.author_association; + const knownAssociations = ['CONTRIBUTOR', 'COLLABORATOR', 'MEMBER', 'OWNER', 'MANNEQUIN']; - if (association !== 'FIRST_TIME_CONTRIBUTOR' && association !== 'FIRST_TIMER') { + if (knownAssociations.includes(association)) { console.log(`Author ${author} has association '${association}', not a first-time contributor`); return; }