File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 28
28
issueOrPrNumber = context.payload.pull_request.number;
29
29
}
30
30
31
+ // Check if an Adafruit member
31
32
try {
32
- // Check for Adafruit membership
33
33
const adafruitResponse = await github.rest.orgs.checkMembershipForUser({
34
34
org: 'adafruit',
35
35
username: username
38
38
if (adafruitResponse.status === 204) {
39
39
console.log('Adafruit Member');
40
40
label = 'Prio Urgent';
41
- } else {
42
- // If not a Adafruit member, check if the user is a contributor
41
+ }
42
+ } catch (error) {
43
+ console.log('Not an Adafruit member');
44
+ }
45
+
46
+ // Check if a contributor
47
+ if (label == '') {
48
+ try {
43
49
const collaboratorResponse = await github.rest.repos.checkCollaborator({
44
50
owner: context.repo.owner,
45
51
repo: context.repo.repo,
50
56
console.log('Contributor');
51
57
label = 'Prio Higher';
52
58
}
59
+ } catch (error) {
60
+ console.log('Not a contributor');
53
61
}
54
- } catch (error) {
55
- console.log(`Error processing user ${username}: ${error.message}`);
56
62
}
57
63
58
64
if (label !== '') {
You can’t perform that action at this time.
0 commit comments