mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-13 16:04:36 -04:00
fix: skip 'help wanted' on linked issue check for Naomi's Sprints assignees (#66542)
This commit is contained in:
@@ -32,6 +32,7 @@ module.exports = async ({ github, context, isAllowListed }) => {
|
||||
nodes {
|
||||
number
|
||||
labels(first: 10) { nodes { name } }
|
||||
assignees(first: 10) { nodes { login } }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,6 +87,22 @@ module.exports = async ({ github, context, isAllowListed }) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const prAuthor = context.payload.pull_request.user.login;
|
||||
const isNaomiSprintAssignee = linkedIssues.some(
|
||||
issue =>
|
||||
issue.labels.nodes.some(l => l.name === "Naomi's Sprints") &&
|
||||
issue.assignees.nodes.some(a => a.login === prAuthor)
|
||||
);
|
||||
if (isNaomiSprintAssignee) {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.payload.pull_request.number,
|
||||
labels: ["Naomi's Sprints"]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const isOpenForContribution = linkedIssues.some(issue =>
|
||||
issue.labels.nodes.some(
|
||||
l => l.name === 'help wanted' || l.name === 'first timers only'
|
||||
|
||||
Reference in New Issue
Block a user