diff --git a/.github/workflows/pr_labeler.yml b/.github/workflows/pr_labeler.yml index cc9c4a9eefd4aa75ba69fb18b353efa6a32778c5..ce5b5f39e6769de8f793b2effd0dee73b2c7d2b8 100644 --- a/.github/workflows/pr_labeler.yml +++ b/.github/workflows/pr_labeler.yml @@ -1,5 +1,6 @@ # Labels pull requests by author: 'bot' for bot accounts, 'staff' for -# staff team members, 'first contribution' for first-time external contributors. +# staff team members, 'guild' for guild members, 'first contribution' for +# first-time external contributors. name: PR Labeler on: @@ -29,8 +30,47 @@ jobs: script: | const BOT_LABEL = 'bot'; const STAFF_LABEL = 'staff'; + const GUILD_LABEL = 'guild'; const FIRST_CONTRIBUTION_LABEL = 'first contribution'; const STAFF_TEAM_SLUG = 'staff'; + const GUILD_MEMBERS = [ + '11happy', + 'AidanV', + 'AmaanBilwar', + 'OmChillure', + 'Palanikannan1437', + 'Shivansh-25', + 'SkandaBhat', + 'TwistingTwists', + 'YEDASAVG', + 'Ziqi-Yang', + 'alanpjohn', + 'arjunkomath', + 'austincummings', + 'ayushk-1801', + 'claiwe', + 'criticic', + 'dongdong867', + 'emamulandalib', + 'eureka928', + 'iam-liam', + 'iksuddle', + 'ishaksebsib', + 'lingyaochu', + 'marcocondrache', + 'mchisolm0', + 'nairadithya', + 'nihalxkumar', + 'notJoon', + 'polyesterswing', + 'prayanshchh', + 'razeghi71', + 'sarmadgulzar', + 'seanstrom', + 'th0jensen', + 'tommyming', + 'virajbhartiya', + ]; const pr = context.payload.pull_request; const author = pr.user.login; @@ -71,6 +111,17 @@ jobs: return; } + if (GUILD_MEMBERS.includes(author)) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr.number, + labels: [GUILD_LABEL] + }); + console.log(`PR #${pr.number} by ${author}: labeled '${GUILD_LABEL}' (guild member)`); + // No early return: guild members can also get 'first contribution' + } + // 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