mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-01 01:20:14 +00:00
more try/catch for labeler
This commit is contained in:
parent
a5b109b699
commit
ec1a06843c
16
.github/workflows/labeler.yml
vendored
16
.github/workflows/labeler.yml
vendored
@ -28,8 +28,8 @@ jobs:
|
|||||||
issueOrPrNumber = context.payload.pull_request.number;
|
issueOrPrNumber = context.payload.pull_request.number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if an Adafruit member
|
||||||
try {
|
try {
|
||||||
// Check for Adafruit membership
|
|
||||||
const adafruitResponse = await github.rest.orgs.checkMembershipForUser({
|
const adafruitResponse = await github.rest.orgs.checkMembershipForUser({
|
||||||
org: 'adafruit',
|
org: 'adafruit',
|
||||||
username: username
|
username: username
|
||||||
@ -38,8 +38,14 @@ jobs:
|
|||||||
if (adafruitResponse.status === 204) {
|
if (adafruitResponse.status === 204) {
|
||||||
console.log('Adafruit Member');
|
console.log('Adafruit Member');
|
||||||
label = 'Prio Urgent';
|
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({
|
const collaboratorResponse = await github.rest.repos.checkCollaborator({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
@ -50,9 +56,9 @@ jobs:
|
|||||||
console.log('Contributor');
|
console.log('Contributor');
|
||||||
label = 'Prio Higher';
|
label = 'Prio Higher';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`Error processing user ${username}: ${error.message}`);
|
console.log('Not a contributor');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (label !== '') {
|
if (label !== '') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user