diff options
| author | hathach <[email protected]> | 2024-04-09 17:37:12 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-04-09 17:37:12 +0700 |
| commit | ec1a06843c15bdbc249002d7914ff3d663e25f2c (patch) | |
| tree | acf4b58714b2a97608f839032a2730c4fcddab24 /.github | |
| parent | a5b109b6995acfa0b14ae41dcce16687cc033d2b (diff) | |
more try/catch for labeler
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/labeler.yml | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 947b08ca2..51ff1cfed 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -28,8 +28,8 @@ jobs: issueOrPrNumber = context.payload.pull_request.number; } + // Check if an Adafruit member try { - // Check for Adafruit membership const adafruitResponse = await github.rest.orgs.checkMembershipForUser({ org: 'adafruit', username: username @@ -38,8 +38,14 @@ jobs: if (adafruitResponse.status === 204) { console.log('Adafruit Member'); label = 'Prio Urgent'; - } else { - // If not a Adafruit member, check if the user is a contributor + } + } catch (error) { + console.log('Not an Adafruit member'); + } + + // Check if a contributor + if (label == '') { + try { const collaboratorResponse = await github.rest.repos.checkCollaborator({ owner: context.repo.owner, repo: context.repo.repo, @@ -50,9 +56,9 @@ jobs: console.log('Contributor'); label = 'Prio Higher'; } + } catch (error) { + console.log('Not a contributor'); } - } catch (error) { - console.log(`Error processing user ${username}: ${error.message}`); } if (label !== '') { |
