@@ -28,29 +28,31 @@ jobs:
28
28
issueOrPrNumber = context.payload.pull_request.number;
29
29
}
30
30
31
- // Check for Adafruit membership
32
- const adafruitResponse = await github.rest.orgs.checkMembershipForUser({
33
- org: 'adafruit',
34
- username: username
35
- });
36
-
37
- if (adafruitResponse.status === 204) {
38
- console.log('Adafruit Member');
39
- label = 'Prio Urgent';
40
- } else {
41
- // Check if the user is a contributor
42
- const collaboratorResponse = await github.rest.repos.checkCollaborator({
43
- owner: context.repo.owner,
44
- repo: context.repo.repo,
31
+ try {
32
+ // Check for Adafruit membership
33
+ const adafruitResponse = await github.rest.orgs.checkMembershipForUser({
34
+ org: 'adafruit',
45
35
username: username
46
36
});
47
37
48
- if (collaboratorResponse .status === 204) {
49
- console.log('Contributor ');
50
- label = 'Prio Higher ';
38
+ if (adafruitResponse .status === 204) {
39
+ console.log('Adafruit Member ');
40
+ label = 'Prio Urgent ';
51
41
} else {
52
- console.log('Not a contributor or Adafruit member');
42
+ // If not a Adafruit member, check if the user is a contributor
43
+ const collaboratorResponse = await github.rest.repos.checkCollaborator({
44
+ owner: context.repo.owner,
45
+ repo: context.repo.repo,
46
+ username: username
47
+ });
48
+
49
+ if (collaboratorResponse.status === 204) {
50
+ console.log('Contributor');
51
+ label = 'Prio Higher';
52
+ }
53
53
}
54
+ } catch (error) {
55
+ console.log(`Error processing user ${username}: ${error.message}`);
54
56
}
55
57
56
58
if (label !== '') {
0 commit comments