fix: skip 'help wanted' on linked issue check for Naomi's Sprints assignees (#66542)

This commit is contained in:
majestic-owl448
2026-03-18 11:41:30 +01:00
committed by GitHub
parent 3baf461012
commit 6469794530

View File

@@ -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'