Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 38 additions & 28 deletions .github/workflows/add-unanswered-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ jobs:
"ethansfng", "ThomasJannaud", "nirvanagth", "marcinkwiatkowski", "3l1", "omerjerk", "nitish2112", "yipjustin",
"ejnguyen", "andrewor14", "phaiting", "mgiordy", "LeeOHzzZ", "adicatana", "Polyomino", "ezrilow", "navsud",
"michaelmaitland", "RahulC7", "seyeong-han", "thdusdl1219", "jaejunku", "felixweilbach", "apullin", "trviv", "junluan01",
"mvartani-meta", "abeakkas", "elpdumont", "corporateshark", "YifanShenSZ", "RdoubleA", "Olivia-liu", "Abhi-hpp", "Vysarat",
"azad-meta", "junpi", "pytorchbot", "pytorchmergebot", "pytorchupdatebot", "facebook-github-bot", "app/dependabot",
"Erik-Lundell", "zingo", "AdrianLundell", "oscarandersson8218", "per", "Sebastian-Larsson", "SaoirseARM", "robell", "mansnils",
"martinlsm", "freddan80", "YufengShi-dudu", "tom-arm", "perheld", "Jerry-Ge", "gggekov", "fumchin", "wwwind", "benkli01",
"Tessil", "maddun01", "Michiel-Olieslagers", "armwaheed", "agrima1304", "emmakujala", "annietllnd", "MatthiasHertel80",
"AlexTawseArm", "jmahbs", "morgolock", "Christoffer-JL", "ArmRyan", "xingguo01", "tgonzalezorlandoarm", "chizkiyahu",
"sarah-blades", "haowhsu-quic", "shewu-quic", "winskuo-quic", "chunit-quic", "DannyYuyang-quic", "chuntl", "thchenqti",
"jethroqti", "chenweng-quic", "cymbalrush", "DenisVieriu97", "billmguo", "StrycekSimon", "jirioc", "robert-kalmar",
"skywall", "MartinPavella", "roman-janik-nxp", "novak-vaclav", "neuropilot-captain", "dijopaul", "cad-rlc", "cad-audio",
"ynimmaga", "daniil-lyakhov", "emmanuel-ferdman", "cavusmustafa", "anzr299", "Jiseong-oh", "alexdean08",
"mvartani-meta", "abeakkas", "elpdumont", "corporateshark", "bdemirb", "GeorgeTzoupis", "AdithyaReddy9", "YifanShenSZ",
"RdoubleA", "Olivia-liu", "Abhi-hpp", "Vysarat","azad-meta", "junpi", "pytorchbot", "pytorchmergebot", "pytorchupdatebot",
"facebook-github-bot", "app/dependabot", "Erik-Lundell", "zingo", "AdrianLundell", "oscarandersson8218", "per",
"Sebastian-Larsson", "SaoirseARM", "robell", "mansnils", "martinlsm", "freddan80", "YufengShi-dudu", "tom-arm", "perheld",
"Jerry-Ge", "gggekov", "fumchin", "wwwind", "benkli01", "Tessil", "maddun01", "Michiel-Olieslagers", "armwaheed", "agrima1304",
"emmakujala", "annietllnd", "MatthiasHertel80", "AlexTawseArm", "jmahbs", "morgolock", "Christoffer-JL", "ArmRyan", "xingguo01",
"tgonzalezorlandoarm", "chizkiyahu", "sarah-blades", "haowhsu-quic", "shewu-quic", "winskuo-quic", "chunit-quic", "DannyYuyang-quic",
"chuntl", "thchenqti", "jethroqti", "chenweng-quic", "cymbalrush", "DenisVieriu97", "billmguo", "StrycekSimon", "jirioc",
"robert-kalmar", "skywall", "MartinPavella", "roman-janik-nxp", "novak-vaclav", "neuropilot-captain", "dijopaul", "cad-rlc",
"cad-audio", "ynimmaga", "daniil-lyakhov", "emmanuel-ferdman", "cavusmustafa", "anzr299", "Jiseong-oh", "alexdean08",
// explicitly include the dependabot bot login seen in PRs
"dependabot[bot]"
]);
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
}

try {
// Add open issues (not PRs) and exclude by author/bots
// Add open issues (not PRs) excluding by author/org/bots
const issues = await github.paginate(
github.rest.issues.listForRepo,
{
Expand All @@ -134,19 +134,22 @@ jobs:
}
);
for (const issue of issues) {
if (!issue.pull_request && !isBotOrExcluded(issue.user)) {
await addItem(issue.node_id, 'issue', issue.number);
} else {
console.log(`Skipping issue #${issue.number} by ${issue.user && issue.user.login}`);
if (issue.pull_request) {
console.log(`Skipping PR #${issue.number} (listed in issues)`);
continue;
}
if (!issue.pull_request && !isBotOrExcluded(issue.user) && !(await isMemberOfExcludedOrg(issue.user))) {
await addItem(issue.node_id, 'issue', issue.number);
} else {
console.log(`Skipping issue #${issue.number} by ${issue.user && issue.user.login}`);
if (isBotOrExcluded(issue.user)) {
console.log(`Skipping issue #${issue.number} by ${issue.user && issue.user.login} (excluded author/bot)`);
continue;
}
if (await isMemberOfExcludedOrg(issue.user)) {
console.log(`Skipping issue #${issue.number} by ${issue.user && issue.user.login} (member of excluded org)`);
continue;
}
await addItem(issue.node_id, 'issue', issue.number);
}

// Add open, non-draft PRs (regardless of review state), exclude by author/bots
// Add open, non-draft PRs (regardless of review state), excluding by author/org/bots/labels
const prs = await github.paginate(
github.rest.pulls.list,
{
Expand All @@ -156,16 +159,23 @@ jobs:
}
);
for (const pr of prs) {
if (!pr.draft && !isBotOrExcluded(pr.user)) {
await addItem(pr.node_id, 'pr', pr.number);
} else {
console.log(`Skipping PR #${pr.number} by ${pr.user && pr.user.login}`);
if (pr.draft) {
console.log(`Skipping PR #${pr.number} (draft)`);
continue;
}
if (!pr.draft && !isBotOrExcluded(pr.user) && !(await isMemberOfExcludedOrg(pr.user))) {
await addItem(pr.node_id, 'pr', pr.number);
} else {
console.log(`Skipping PR #${pr.number} by ${pr.user && pr.user.login}`);
if (hasExcludedLabel(pr)) {
console.log(`Skipping PR #${pr.number} (has excluded label)`);
continue;
}
if (isBotOrExcluded(pr.user)) {
console.log(`Skipping PR #${pr.number} by ${pr.user && pr.user.login} (excluded author/bot)`);
continue;
}
if (await isMemberOfExcludedOrg(pr.user)) {
console.log(`Skipping PR #${pr.number} by ${pr.user && pr.user.login} (member of excluded org)`);
continue;
}
await addItem(pr.node_id, 'pr', pr.number);
}
} catch (error) {
core.setFailed(`Workflow failed: ${error.message}`);
Expand Down
Loading