From c251648b2029cb9389e2ac6034b69e5db1d68c4d Mon Sep 17 00:00:00 2001 From: Nikhil Viswanath Sivakumar <68182521+nil-is-all@users.noreply.github.com> Date: Tue, 23 Dec 2025 11:14:22 -0600 Subject: [PATCH 1/2] Add cron schedule for 8 am CT & 1 pm CT, and exclude dependabot & tgonzalezorlandoarm Updated workflow to include scheduled runs and refine exclusion logic for bots and authors. --- .../workflows/add-unanswered-to-project.yml | 49 ++++++++++++++----- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/.github/workflows/add-unanswered-to-project.yml b/.github/workflows/add-unanswered-to-project.yml index cd614996f37..39667641bc3 100644 --- a/.github/workflows/add-unanswered-to-project.yml +++ b/.github/workflows/add-unanswered-to-project.yml @@ -2,14 +2,20 @@ name: Add Open External Contributor PRs and Issues to PyTorch Org Project 136 on: workflow_dispatch: - pull_request: - paths: - .github/workflows/add-unanswered-to-project.yml + schedule: + # GitHub Actions cron uses UTC. These run at: + # - 14:00 UTC -> 08:00 CST (UTC-6) + # - 19:00 UTC -> 13:00 CST (UTC-6) + - cron: "0 14 * * *" + - cron: "0 19 * * *" + pull_request: + paths: + - .github/workflows/add-unanswered-to-project.yml jobs: add_to_project: runs-on: ubuntu-latest steps: - - name: Add open issues and open, non-draft PRs to org project (excluding certain authors) + - name: Add open issues and open, non-draft PRs to org project (excluding certain authors and bots) uses: actions/github-script@v7 with: github-token: ${{ secrets.ET_EXT_CONTRIB }} @@ -41,13 +47,26 @@ jobs: "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", "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" + "MatthiasHertel80", "AlexTawseArm", "jmahbs", "morgolock", "Christoffer-JL", "ArmRyan", "xingguo01", "tgonzalezorlandoarm", + "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]" ]); + function isBotOrExcluded(user) { + if (!user) return false; + // GitHub sometimes marks bots with user.type === "Bot" + if (user.type && user.type.toLowerCase() === "bot") return true; + // Some bots use logins that end with [bot], e.g. dependabot[bot] + if (user.login && user.login.endsWith("[bot]")) return true; + // Explicit excluded list + if (excludedAuthors.has(user.login)) return true; + return false; + } + async function addItem(contentId, type, number) { try { await github.graphql(` @@ -69,7 +88,7 @@ jobs: } try { - // Add open issues (not PRs) and exclude by author + // Add open issues (not PRs) and exclude by author/bots const issues = await github.paginate( github.rest.issues.listForRepo, { @@ -80,12 +99,14 @@ jobs: } ); for (const issue of issues) { - if (!issue.pull_request && !excludedAuthors.has(issue.user.login)) { + 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}`); } } - // Add open, non-draft PRs (regardless of review state), exclude by author + // Add open, non-draft PRs (regardless of review state), exclude by author/bots const prs = await github.paginate( github.rest.pulls.list, { @@ -95,8 +116,10 @@ jobs: } ); for (const pr of prs) { - if (!pr.draft && !excludedAuthors.has(pr.user.login)) { + 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}`); } } } catch (error) { From 6e437aaee37b2235e73ef7ef843120446292f45a Mon Sep 17 00:00:00 2001 From: Nikhil Viswanath Sivakumar <68182521+nil-is-all@users.noreply.github.com> Date: Tue, 23 Dec 2025 14:00:57 -0600 Subject: [PATCH 2/2] Fix formatting in add-unanswered-to-project.yml --- .github/workflows/add-unanswered-to-project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add-unanswered-to-project.yml b/.github/workflows/add-unanswered-to-project.yml index 39667641bc3..24fae58aead 100644 --- a/.github/workflows/add-unanswered-to-project.yml +++ b/.github/workflows/add-unanswered-to-project.yml @@ -50,7 +50,7 @@ jobs: "MatthiasHertel80", "AlexTawseArm", "jmahbs", "morgolock", "Christoffer-JL", "ArmRyan", "xingguo01", "tgonzalezorlandoarm", "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", + "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]"