File tree Expand file tree Collapse file tree 1 file changed +7
-16
lines changed
Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -270,31 +270,22 @@ jobs:
270270
271271 const contributorLabels = [];
272272
273- // Check if contributor is a member of the organization
274- try {
275- await github.rest.orgs.checkMembershipForUser({
276- org: context.repo.owner,
277- username: prAuthor
278- });
279- contributorLabels.push('member');
280- } catch (error) {
281- // Not a member
282- if (commits.data.length <= 1) {
283- contributorLabels.push('first-time-contributor');
284- } else {
285- contributorLabels.push('external-contributor');
286- }
273+ // Determine contributor type based on commit count
274+ if (commits.data.length <= 1) {
275+ contributorLabels.push('first-time-contributor');
276+ } else {
277+ contributorLabels.push('external-contributor');
287278 }
288279
289- // Check if PR author is a collaborator
280+ // Maintainer check
290281 try {
291282 const permissionLevel = await github.rest.repos.getCollaboratorPermissionLevel({
292283 owner: context.repo.owner,
293284 repo: context.repo.repo,
294285 username: prAuthor
295286 });
296287
297- if (permissionLevel.data.permission === 'admin' || permissionLevel.data.permission === 'maintain' ) {
288+ if ([ 'admin', 'maintain'].includes( permissionLevel.data.permission) ) {
298289 contributorLabels.push('maintainer');
299290 }
300291 } catch (error) {
You can’t perform that action at this time.
0 commit comments