From d37fea53b9e008a8a1f88902871f85a72bf59925 Mon Sep 17 00:00:00 2001 From: Bel Ami Gisage Warakoze <125438939+Belami02@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:24:43 +0300 Subject: [PATCH 1/5] Debugging the feature added (PR) --- .github/workflows/TriageClosedIssue.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/TriageClosedIssue.yml b/.github/workflows/TriageClosedIssue.yml index 3871d0ba623..9a06cb4602f 100644 --- a/.github/workflows/TriageClosedIssue.yml +++ b/.github/workflows/TriageClosedIssue.yml @@ -56,6 +56,7 @@ jobs: }); prAuthors = [...new Set(prAuthors)]; + console.log(prAuthors) if (!assigned) { if (issueData.assignees.length != 0) { const assignees = issueData.assignees.map(assignee => assignee.login).join(', '); @@ -75,9 +76,9 @@ jobs: issue_number: sandboxIssueNumber, owner: sandboxOwner, repo: sandboxRepo, - body: resultString + body: resultString, }); - \ No newline at end of file + From 0aed6fc235f0d5b9270b868022294147250bdebc Mon Sep 17 00:00:00 2001 From: Bel Ami Gisage Warakoze <125438939+Belami02@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:26:59 +0300 Subject: [PATCH 2/5] Changed the sandbox number and the rest.issues (script@v7) --- .github/workflows/TriageClosedIssue.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/TriageClosedIssue.yml b/.github/workflows/TriageClosedIssue.yml index 9a06cb4602f..d7ee48cfa0e 100644 --- a/.github/workflows/TriageClosedIssue.yml +++ b/.github/workflows/TriageClosedIssue.yml @@ -26,7 +26,7 @@ jobs: const commentsUrl = issueData.comments_url; const { data: commentsData } = await github.request(commentsUrl); - const sandboxIssueNumber = 19673; + const sandboxIssueNumber = 1; const sandboxOwner = context.repo.owner; const sandboxRepo = context.repo.repo; @@ -40,7 +40,7 @@ jobs: // Check if there is a closed/merged pull request associated with the issue // Check if the pull request has been merged let prAuthors = []; - const timeline = await github.rest.issues.listEventsForTimeline({ + const timeline = await github.issues.listEventsForTimeline({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, From d120048ee2965dc9c849f445a77f0b3fc6c08cc6 Mon Sep 17 00:00:00 2001 From: Bel Ami Gisage Warakoze <125438939+Belami02@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:28:21 +0300 Subject: [PATCH 3/5] Fixed the wrong name --- .github/workflows/TriageClosedIssue.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TriageClosedIssue.yml b/.github/workflows/TriageClosedIssue.yml index d7ee48cfa0e..b63cce1baa2 100644 --- a/.github/workflows/TriageClosedIssue.yml +++ b/.github/workflows/TriageClosedIssue.yml @@ -66,7 +66,7 @@ jobs: } } - if (prCreators.length > 0) { + if (prAuthors.length > 0) { resultString += `PR Authors: ${prAuthors.join(', ')}\n`; } else { resultString += `PR Authors: No one :(\n`; From 1e33ecd5737402bf6b835cff380ab122492cac03 Mon Sep 17 00:00:00 2001 From: Bel Ami Gisage Warakoze <125438939+Belami02@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:30:48 +0300 Subject: [PATCH 4/5] Fixed newlines --- .github/workflows/TriageClosedIssue.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/TriageClosedIssue.yml b/.github/workflows/TriageClosedIssue.yml index b63cce1baa2..040844b338b 100644 --- a/.github/workflows/TriageClosedIssue.yml +++ b/.github/workflows/TriageClosedIssue.yml @@ -60,16 +60,16 @@ jobs: if (!assigned) { if (issueData.assignees.length != 0) { const assignees = issueData.assignees.map(assignee => assignee.login).join(', '); - resultString += `Actual Assignees: ${assignees}`; + resultString += `Actual Assignees: ${assignees}\n`; } else { - resultString += "Actual Assignees: No one :("; + resultString += "Actual Assignees: No one :(\n"; } } if (prAuthors.length > 0) { - resultString += `PR Authors: ${prAuthors.join(', ')}\n`; + resultString += `PR Authors: ${prAuthors.join(', ')}`; } else { - resultString += `PR Authors: No one :(\n`; + resultString += `PR Authors: No one :(`; } await github.issues.createComment({ From b5a6cbc280a18ecb06db30fdd212a5f4f57795eb Mon Sep 17 00:00:00 2001 From: coolujain <143888770+coolujain@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:36:20 +0300 Subject: [PATCH 5/5] deleted code that we used for debugging purposes --- .github/workflows/TriageClosedIssue.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/TriageClosedIssue.yml b/.github/workflows/TriageClosedIssue.yml index 040844b338b..f75967360f3 100644 --- a/.github/workflows/TriageClosedIssue.yml +++ b/.github/workflows/TriageClosedIssue.yml @@ -56,7 +56,6 @@ jobs: }); prAuthors = [...new Set(prAuthors)]; - console.log(prAuthors) if (!assigned) { if (issueData.assignees.length != 0) { const assignees = issueData.assignees.map(assignee => assignee.login).join(', ');