From f686eb9fde504bc78be14f515b6c62acefa8e1a5 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 8 Aug 2025 14:53:16 -0500 Subject: [PATCH 01/10] Add round robin issue assigned and inactivity action --- .github/workflows/inactivity_reminder.yaml | 69 ++++++++++++++++++++++ .github/workflows/round_robin_assign.yaml | 61 +++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 .github/workflows/inactivity_reminder.yaml create mode 100644 .github/workflows/round_robin_assign.yaml diff --git a/.github/workflows/inactivity_reminder.yaml b/.github/workflows/inactivity_reminder.yaml new file mode 100644 index 0000000000..8e3155f1e3 --- /dev/null +++ b/.github/workflows/inactivity_reminder.yaml @@ -0,0 +1,69 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Inactivity Reminder with Different Times + +on: + schedule: + - cron: '0 9 * * *' # Runs daily at 09:00 UTC + +jobs: + remind: + runs-on: ubuntu-latest + steps: + - name: Remind inactive issues and PRs with different thresholds + uses: actions/github-script@v6 + with: + script: | + const MS_IN_DAY = 24 * 60 * 60 * 1000; + const now = new Date(); + + // Inactivity thresholds in days + const ISSUE_INACTIVITY_DAYS = 21; // 3 weeks + const PR_INACTIVITY_DAYS = 7; // 1 week + + function isInactive(updatedAt, thresholdDays) { + const updatedDate = new Date(updatedAt); + return (now - updatedDate) > thresholdDays * MS_IN_DAY; + } + + const issuesAndPRs = await github.paginate(github.rest.issues.listForRepo, { + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + per_page: 100, + }); + + for (const item of issuesAndPRs) { + if (!item.assignees || item.assignees.length === 0) continue; + + const isPR = !!item.pull_request; + const thresholdDays = isPR ? PR_INACTIVITY_DAYS : ISSUE_INACTIVITY_DAYS; + + if (isInactive(item.updated_at, thresholdDays)) { + const mentions = item.assignees.map(a => `@${a.login}`).join(' '); + const issueNumber = item.number; + const type = isPR ? "pull request" : "issue"; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + body: `⚠️ Hi ${mentions}, this ${type} has had no activity for ${thresholdDays} days. Please update or let us know if it can be closed. Thank you!`, + }); + + console.log(`Posted reminder on #${issueNumber} (${type}) to ${mentions}`); + } + } diff --git a/.github/workflows/round_robin_assign.yaml b/.github/workflows/round_robin_assign.yaml new file mode 100644 index 0000000000..a283d51e40 --- /dev/null +++ b/.github/workflows/round_robin_assign.yaml @@ -0,0 +1,61 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Round-Robin Issue Assigner + +on: + issues: + types: [opened] + +jobs: + assign: + runs-on: ubuntu-latest + steps: + - name: Assign issue round-robin only if unassigned + uses: actions/github-script@v6 + with: + script: | + const assignees = [ + 'kaatish', + 'rg20', + 'akifcorduk', + 'hlinsen', + 'Kh4ster', + 'aliceb-nv', + 'chris-maes', + 'rgsl888prabhu', + 'Iroy30', + 'tmckayus' + ]; + + const issue = context.payload.issue; + + // Only assign if no one is assigned yet + if (!issue.assignees || issue.assignees.length === 0) { + const issueNumber = issue.number; + const index = (issueNumber - 1) % assignees.length; + const assignee = assignees[index]; + + console.log(`Assigning issue #${issueNumber} to @${assignee}`); + + await github.rest.issues.addAssignees({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + assignees: [assignee], + }); + } else { + console.log(`Issue #${issue.number} already has assignees, skipping.`); + } From 1eca540cea9504c687abc9f6e9e4e19c1798b2b0 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 8 Aug 2025 14:59:05 -0500 Subject: [PATCH 02/10] Update inactivity --- .github/workflows/inactivity_reminder.yaml | 28 ++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/inactivity_reminder.yaml b/.github/workflows/inactivity_reminder.yaml index 8e3155f1e3..b36ace2831 100644 --- a/.github/workflows/inactivity_reminder.yaml +++ b/.github/workflows/inactivity_reminder.yaml @@ -23,28 +23,35 @@ jobs: remind: runs-on: ubuntu-latest steps: - - name: Remind inactive issues and PRs with different thresholds + - name: Remind inactive issues and PRs uses: actions/github-script@v6 with: script: | const MS_IN_DAY = 24 * 60 * 60 * 1000; const now = new Date(); - // Inactivity thresholds in days + // Thresholds const ISSUE_INACTIVITY_DAYS = 21; // 3 weeks const PR_INACTIVITY_DAYS = 7; // 1 week + // Always notify this user + const defaultNotify = '@anandhkb'; + function isInactive(updatedAt, thresholdDays) { const updatedDate = new Date(updatedAt); return (now - updatedDate) > thresholdDays * MS_IN_DAY; } - const issuesAndPRs = await github.paginate(github.rest.issues.listForRepo, { - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open', - per_page: 100, - }); + // Fetch all open issues + PRs (paginate if >100) + const issuesAndPRs = await github.paginate( + github.rest.issues.listForRepo, + { + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + per_page: 100, + } + ); for (const item of issuesAndPRs) { if (!item.assignees || item.assignees.length === 0) continue; @@ -53,7 +60,8 @@ jobs: const thresholdDays = isPR ? PR_INACTIVITY_DAYS : ISSUE_INACTIVITY_DAYS; if (isInactive(item.updated_at, thresholdDays)) { - const mentions = item.assignees.map(a => `@${a.login}`).join(' '); + const assigneeMentions = item.assignees.map(a => `@${a.login}`).join(' '); + const mentions = `${defaultNotify} ${assigneeMentions}`.trim(); const issueNumber = item.number; const type = isPR ? "pull request" : "issue"; @@ -66,4 +74,4 @@ jobs: console.log(`Posted reminder on #${issueNumber} (${type}) to ${mentions}`); } - } + } \ No newline at end of file From d8f2f2ac6fd69a0ea480b7fcbf0da794e4b24fab Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 8 Aug 2025 15:01:33 -0500 Subject: [PATCH 03/10] fix style --- .github/workflows/inactivity_reminder.yaml | 2 +- .github/workflows/round_robin_assign.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/inactivity_reminder.yaml b/.github/workflows/inactivity_reminder.yaml index b36ace2831..dd99703180 100644 --- a/.github/workflows/inactivity_reminder.yaml +++ b/.github/workflows/inactivity_reminder.yaml @@ -74,4 +74,4 @@ jobs: console.log(`Posted reminder on #${issueNumber} (${type}) to ${mentions}`); } - } \ No newline at end of file + } diff --git a/.github/workflows/round_robin_assign.yaml b/.github/workflows/round_robin_assign.yaml index a283d51e40..4060ad70e1 100644 --- a/.github/workflows/round_robin_assign.yaml +++ b/.github/workflows/round_robin_assign.yaml @@ -47,7 +47,7 @@ jobs: const issueNumber = issue.number; const index = (issueNumber - 1) % assignees.length; const assignee = assignees[index]; - + console.log(`Assigning issue #${issueNumber} to @${assignee}`); await github.rest.issues.addAssignees({ From 8afd28d819d8e2e49855526e856a240ff3b76292 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 15 Aug 2025 13:54:06 -0500 Subject: [PATCH 04/10] update --- .github/workflows/inactivity_reminder.yaml | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/inactivity_reminder.yaml b/.github/workflows/inactivity_reminder.yaml index dd99703180..1804556ee9 100644 --- a/.github/workflows/inactivity_reminder.yaml +++ b/.github/workflows/inactivity_reminder.yaml @@ -56,10 +56,35 @@ jobs: for (const item of issuesAndPRs) { if (!item.assignees || item.assignees.length === 0) continue; + // Skip if issue/PR has the skip_inactivity_reminder label + if (item.labels && item.labels.some(label => label.name === 'skip_inactivity_reminder')) { + console.log(`Skipping #${item.number} due to skip_inactivity_reminder label`); + continue; + } + const isPR = !!item.pull_request; + + // Skip if PR is in Draft mode + if (isPR && item.draft) { + console.log(`Skipping #${item.number} due to Draft PR status`); + continue; + } + + // Skip if issue (not PR) is an EPIC + if (!isPR && item.labels && item.labels.some(label => label.name === 'EPIC')) { + console.log(`Skipping #${item.number} due to EPIC label (issue only)`); + continue; + } + const thresholdDays = isPR ? PR_INACTIVITY_DAYS : ISSUE_INACTIVITY_DAYS; if (isInactive(item.updated_at, thresholdDays)) { + // For issues, only send reminder if they have "awaiting response" label + if (!isPR && (!item.labels || !item.labels.some(label => label.name === 'awaiting response'))) { + console.log(`Skipping #${item.number} (issue) - no awaiting response label`); + continue; + } + const assigneeMentions = item.assignees.map(a => `@${a.login}`).join(' '); const mentions = `${defaultNotify} ${assigneeMentions}`.trim(); const issueNumber = item.number; From 9a6dc652c9bd5d3b1981a17c5c5cfefbc1b774cd Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 15 Aug 2025 14:00:03 -0500 Subject: [PATCH 05/10] update workflow --- .github/workflows/auto_label_issues.yaml | 44 ++++++++++++++++++++++ .github/workflows/inactivity_reminder.yaml | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/auto_label_issues.yaml diff --git a/.github/workflows/auto_label_issues.yaml b/.github/workflows/auto_label_issues.yaml new file mode 100644 index 0000000000..932550d67f --- /dev/null +++ b/.github/workflows/auto_label_issues.yaml @@ -0,0 +1,44 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Auto-label New Issues + +on: + issues: + types: [opened] + +jobs: + auto-label: + runs-on: ubuntu-latest + steps: + - name: Add awaiting response label to new issues + uses: actions/github-script@v6 + with: + script: | + // Only process issues (not PRs) + if (context.payload.issue && !context.payload.issue.pull_request) { + console.log(`Adding 'awaiting response' label to issue #${context.payload.issue.number}`); + + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.issue.number, + labels: ['awaiting response'] + }); + + console.log(`Successfully added 'awaiting response' label to issue #${context.payload.issue.number}`); + } else { + console.log('Skipping - this is a pull request, not an issue'); + } diff --git a/.github/workflows/inactivity_reminder.yaml b/.github/workflows/inactivity_reminder.yaml index 1804556ee9..c7f5922f50 100644 --- a/.github/workflows/inactivity_reminder.yaml +++ b/.github/workflows/inactivity_reminder.yaml @@ -71,7 +71,7 @@ jobs: } // Skip if issue (not PR) is an EPIC - if (!isPR && item.labels && item.labels.some(label => label.name === 'EPIC')) { + if (!isPR && item.labels && item.labels.some(label => label.name === 'epic')) { console.log(`Skipping #${item.number} due to EPIC label (issue only)`); continue; } From d1a39842ae7b8d4ef6c6f92ebf855a22ecbe8261 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 15 Aug 2025 17:17:37 -0500 Subject: [PATCH 06/10] changes --- .github/workflows/inactivity_reminder.yaml | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/inactivity_reminder.yaml b/.github/workflows/inactivity_reminder.yaml index c7f5922f50..474a33184b 100644 --- a/.github/workflows/inactivity_reminder.yaml +++ b/.github/workflows/inactivity_reminder.yaml @@ -54,11 +54,9 @@ jobs: ); for (const item of issuesAndPRs) { - if (!item.assignees || item.assignees.length === 0) continue; - - // Skip if issue/PR has the skip_inactivity_reminder label - if (item.labels && item.labels.some(label => label.name === 'skip_inactivity_reminder')) { - console.log(`Skipping #${item.number} due to skip_inactivity_reminder label`); + // Skip if issue/PR has the skip inactivity reminder label + if (item.labels && item.labels.some(label => label.name === 'skip inactivity reminder')) { + console.log(`Skipping #${item.number} due to skip inactivity reminder label`); continue; } @@ -85,8 +83,12 @@ jobs: continue; } - const assigneeMentions = item.assignees.map(a => `@${a.login}`).join(' '); - const mentions = `${defaultNotify} ${assigneeMentions}`.trim(); + const assigneeMentions = item.assignees && item.assignees.length > 0 + ? item.assignees.map(a => `@${a.login}`).join(' ') + : ''; + const mentions = assigneeMentions + ? `${defaultNotify} ${assigneeMentions}`.trim() + : defaultNotify; const issueNumber = item.number; const type = isPR ? "pull request" : "issue"; @@ -94,7 +96,13 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, issue_number: issueNumber, - body: `⚠️ Hi ${mentions}, this ${type} has had no activity for ${thresholdDays} days. Please update or let us know if it can be closed. Thank you!`, + body: [ + `🔔 Hi ${mentions}, this ${type} has had no activity for ${thresholdDays} days. Please update or let us know if it can be closed. Thank you!`, + '', + 'If this is an "epic" issue, then please add the "epic" label to this issue.', + 'If it is a PR and needs a lot of time, then please convert this to draft.', + 'If you just want to switch off this notification, then use the "skip inactivity reminder" label.' + ].join('\n'), }); console.log(`Posted reminder on #${issueNumber} (${type}) to ${mentions}`); From 0e5e4ea4999314bbb250f2f8408d40a9de777ee2 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 15 Aug 2025 17:18:07 -0500 Subject: [PATCH 07/10] style --- .github/workflows/auto_label_issues.yaml | 4 ++-- .github/workflows/inactivity_reminder.yaml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto_label_issues.yaml b/.github/workflows/auto_label_issues.yaml index 932550d67f..0fcc14f2c2 100644 --- a/.github/workflows/auto_label_issues.yaml +++ b/.github/workflows/auto_label_issues.yaml @@ -30,14 +30,14 @@ jobs: // Only process issues (not PRs) if (context.payload.issue && !context.payload.issue.pull_request) { console.log(`Adding 'awaiting response' label to issue #${context.payload.issue.number}`); - + await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.payload.issue.number, labels: ['awaiting response'] }); - + console.log(`Successfully added 'awaiting response' label to issue #${context.payload.issue.number}`); } else { console.log('Skipping - this is a pull request, not an issue'); diff --git a/.github/workflows/inactivity_reminder.yaml b/.github/workflows/inactivity_reminder.yaml index 474a33184b..537302c9d1 100644 --- a/.github/workflows/inactivity_reminder.yaml +++ b/.github/workflows/inactivity_reminder.yaml @@ -61,13 +61,13 @@ jobs: } const isPR = !!item.pull_request; - + // Skip if PR is in Draft mode if (isPR && item.draft) { console.log(`Skipping #${item.number} due to Draft PR status`); continue; } - + // Skip if issue (not PR) is an EPIC if (!isPR && item.labels && item.labels.some(label => label.name === 'epic')) { console.log(`Skipping #${item.number} due to EPIC label (issue only)`); @@ -83,10 +83,10 @@ jobs: continue; } - const assigneeMentions = item.assignees && item.assignees.length > 0 + const assigneeMentions = item.assignees && item.assignees.length > 0 ? item.assignees.map(a => `@${a.login}`).join(' ') : ''; - const mentions = assigneeMentions + const mentions = assigneeMentions ? `${defaultNotify} ${assigneeMentions}`.trim() : defaultNotify; const issueNumber = item.number; From 668f7828735c84eb29e4e269ce73737f812bc261 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Fri, 15 Aug 2025 17:30:26 -0500 Subject: [PATCH 08/10] changes msg --- .github/workflows/inactivity_reminder.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/inactivity_reminder.yaml b/.github/workflows/inactivity_reminder.yaml index 537302c9d1..adc2f0c657 100644 --- a/.github/workflows/inactivity_reminder.yaml +++ b/.github/workflows/inactivity_reminder.yaml @@ -100,7 +100,7 @@ jobs: `🔔 Hi ${mentions}, this ${type} has had no activity for ${thresholdDays} days. Please update or let us know if it can be closed. Thank you!`, '', 'If this is an "epic" issue, then please add the "epic" label to this issue.', - 'If it is a PR and needs a lot of time, then please convert this to draft.', + 'If it is a PR and not ready for review, then please convert this to draft.', 'If you just want to switch off this notification, then use the "skip inactivity reminder" label.' ].join('\n'), }); From 420cad4081f3b5826d291c6093f0b17c33ea305d Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 18 Aug 2025 08:13:46 -0500 Subject: [PATCH 09/10] combine round robing and issue labeling in one workflow --- .github/workflows/auto_label_issues.yaml | 44 ----------- .github/workflows/issue_automation.yaml | 95 +++++++++++++++++++++++ .github/workflows/round_robin_assign.yaml | 61 --------------- 3 files changed, 95 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/auto_label_issues.yaml create mode 100644 .github/workflows/issue_automation.yaml delete mode 100644 .github/workflows/round_robin_assign.yaml diff --git a/.github/workflows/auto_label_issues.yaml b/.github/workflows/auto_label_issues.yaml deleted file mode 100644 index 0fcc14f2c2..0000000000 --- a/.github/workflows/auto_label_issues.yaml +++ /dev/null @@ -1,44 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Auto-label New Issues - -on: - issues: - types: [opened] - -jobs: - auto-label: - runs-on: ubuntu-latest - steps: - - name: Add awaiting response label to new issues - uses: actions/github-script@v6 - with: - script: | - // Only process issues (not PRs) - if (context.payload.issue && !context.payload.issue.pull_request) { - console.log(`Adding 'awaiting response' label to issue #${context.payload.issue.number}`); - - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.issue.number, - labels: ['awaiting response'] - }); - - console.log(`Successfully added 'awaiting response' label to issue #${context.payload.issue.number}`); - } else { - console.log('Skipping - this is a pull request, not an issue'); - } diff --git a/.github/workflows/issue_automation.yaml b/.github/workflows/issue_automation.yaml new file mode 100644 index 0000000000..145535df2e --- /dev/null +++ b/.github/workflows/issue_automation.yaml @@ -0,0 +1,95 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Auto-label and Round-Robin Assign Issues + +on: + issues: + types: [opened] + +jobs: + auto-label: + runs-on: ubuntu-latest + steps: + - name: Add awaiting response label to new issues + uses: actions/github-script@v6 + with: + script: | + // Only process issues (not PRs) + if (context.payload.issue && !context.payload.issue.pull_request) { + const issue = context.payload.issue; + const issueNumber = issue.number; + + console.log(`Adding 'awaiting response' label to issue #${issueNumber}`); + + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + labels: ['awaiting response'] + }); + + console.log(`Successfully added 'awaiting response' label to issue #${issueNumber}`); + } else { + console.log('Skipping - this is a pull request, not an issue'); + } + + round-robin-assign: + runs-on: ubuntu-latest + steps: + - name: Assign issue round-robin only if unassigned + uses: actions/github-script@v6 + with: + script: | + // Only process issues (not PRs) + if (context.payload.issue && !context.payload.issue.pull_request) { + const issue = context.payload.issue; + const issueNumber = issue.number; + + // Round-robin assignment logic + const assignees = [ + 'kaatish', + 'rg20', + 'akifcorduk', + 'hlinsen', + 'Kh4ster', + 'aliceb-nv', + 'chris-maes', + 'rgsl888prabhu', + 'Iroy30', + 'tmckayus' + ]; + + // Only assign if no one is assigned yet + if (!issue.assignees || issue.assignees.length === 0) { + const index = (issueNumber - 1) % assignees.length; + const assignee = assignees[index]; + + console.log(`Assigning issue #${issueNumber} to @${assignee}`); + + await github.rest.issues.addAssignees({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + assignees: [assignee], + }); + + console.log(`Successfully assigned issue #${issueNumber} to @${assignee}`); + } else { + console.log(`Issue #${issueNumber} already has assignees, skipping assignment.`); + } + } else { + console.log('Skipping - this is a pull request, not an issue'); + } diff --git a/.github/workflows/round_robin_assign.yaml b/.github/workflows/round_robin_assign.yaml deleted file mode 100644 index 4060ad70e1..0000000000 --- a/.github/workflows/round_robin_assign.yaml +++ /dev/null @@ -1,61 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: Round-Robin Issue Assigner - -on: - issues: - types: [opened] - -jobs: - assign: - runs-on: ubuntu-latest - steps: - - name: Assign issue round-robin only if unassigned - uses: actions/github-script@v6 - with: - script: | - const assignees = [ - 'kaatish', - 'rg20', - 'akifcorduk', - 'hlinsen', - 'Kh4ster', - 'aliceb-nv', - 'chris-maes', - 'rgsl888prabhu', - 'Iroy30', - 'tmckayus' - ]; - - const issue = context.payload.issue; - - // Only assign if no one is assigned yet - if (!issue.assignees || issue.assignees.length === 0) { - const issueNumber = issue.number; - const index = (issueNumber - 1) % assignees.length; - const assignee = assignees[index]; - - console.log(`Assigning issue #${issueNumber} to @${assignee}`); - - await github.rest.issues.addAssignees({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issueNumber, - assignees: [assignee], - }); - } else { - console.log(`Issue #${issue.number} already has assignees, skipping.`); - } From 9a3af80c5872e75cafafe97d4e720bf8d5920431 Mon Sep 17 00:00:00 2001 From: Ramakrishna Prabhu Date: Mon, 18 Aug 2025 08:57:39 -0500 Subject: [PATCH 10/10] fix issue --- .github/workflows/issue_automation.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/issue_automation.yaml b/.github/workflows/issue_automation.yaml index 145535df2e..e57462c046 100644 --- a/.github/workflows/issue_automation.yaml +++ b/.github/workflows/issue_automation.yaml @@ -31,7 +31,7 @@ jobs: if (context.payload.issue && !context.payload.issue.pull_request) { const issue = context.payload.issue; const issueNumber = issue.number; - + console.log(`Adding 'awaiting response' label to issue #${issueNumber}`); await github.rest.issues.addLabels({ @@ -85,7 +85,7 @@ jobs: issue_number: issueNumber, assignees: [assignee], }); - + console.log(`Successfully assigned issue #${issueNumber} to @${assignee}`); } else { console.log(`Issue #${issueNumber} already has assignees, skipping assignment.`);