diff options
| author | hathach <[email protected]> | 2024-04-05 17:59:38 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-04-05 17:59:38 +0700 |
| commit | 1c5abc835fb43f5784cc4883581eea09806e44a8 (patch) | |
| tree | 9f278a026925da937d4cf74ea6f25b6f0c6e0436 /.github | |
| parent | 5ce458588498090204cdc7c3977c0fd48e00d710 (diff) | |
| parent | 5738757e2ca73ab003df5bfbf5ec7b60850ef88b (diff) | |
Merge branch 'master' into MCX
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/labeler.yml | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 4733c6f06..947b08ca2 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -28,29 +28,31 @@ jobs: issueOrPrNumber = context.payload.pull_request.number; } - // Check for Adafruit membership - const adafruitResponse = await github.rest.orgs.checkMembershipForUser({ - org: 'adafruit', - username: username - }); - - if (adafruitResponse.status === 204) { - console.log('Adafruit Member'); - label = 'Prio Urgent'; - } else { - // Check if the user is a contributor - const collaboratorResponse = await github.rest.repos.checkCollaborator({ - owner: context.repo.owner, - repo: context.repo.repo, + try { + // Check for Adafruit membership + const adafruitResponse = await github.rest.orgs.checkMembershipForUser({ + org: 'adafruit', username: username }); - if (collaboratorResponse.status === 204) { - console.log('Contributor'); - label = 'Prio Higher'; + if (adafruitResponse.status === 204) { + console.log('Adafruit Member'); + label = 'Prio Urgent'; } else { - console.log('Not a contributor or Adafruit member'); + // If not a Adafruit member, check if the user is a contributor + const collaboratorResponse = await github.rest.repos.checkCollaborator({ + owner: context.repo.owner, + repo: context.repo.repo, + username: username + }); + + if (collaboratorResponse.status === 204) { + console.log('Contributor'); + label = 'Prio Higher'; + } } + } catch (error) { + console.log(`Error processing user ${username}: ${error.message}`); } if (label !== '') { |
