Skip to content

Commit d9e283e

Browse files
committed
Log statement changes
Signed-off-by: Mounil <[email protected]>
1 parent 9312c73 commit d9e283e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/scripts/bot-mentor-assignment.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ async function isNewContributor(github, owner, repo, login) {
6666
return (response.data.total_count || 0) === 0;
6767
} catch (error) {
6868
console.log(`Unable to determine merged PRs for ${login}:`, error.message || error);
69-
// Return false (skip assignment) on API errors to avoid workflow failure
70-
return false;
69+
// Return null (skip assignment) on API errors to avoid workflow failure while preserving accurate logging
70+
return null;
7171
}
7272
}
7373

@@ -128,6 +128,11 @@ module.exports = async ({ github, context }) => {
128128
}
129129

130130
const isNewStarter = await isNewContributor(github, owner, repo, mentee);
131+
132+
if (isNewStarter === null) {
133+
return console.log(`Unable to confirm whether ${mentee} is a new contributor due to API error. Skipping mentor assignment.`);
134+
}
135+
131136
if (!isNewStarter) {
132137
return console.log(`${mentee} already has merged contributions. Skipping mentor assignment.`);
133138
}

0 commit comments

Comments
 (0)