From 4e1da0d79ae46001a95fc08e84b8e972ef78ef21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maty=C3=A1=C5=A1=20Caras?= Date: Tue, 30 Jul 2024 17:30:31 +0200 Subject: [PATCH] chore: reduce lines by using content of context.repo --- dist/index.js | 6 ++---- src/index.ts | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 8809eec..5e63fdd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -45388,8 +45388,7 @@ try { } octokit.rest.issues.createComment({ issue_number: issue.number, - owner: github.context.payload.repository?.owner.login ?? "", - repo: github.context.payload.repository?.name ?? "", + ...github.context.repo, body: `Freelo task assigned: ${res.data.id}
Please do not edit or delete this comment as it is used to prevent duplication of tasks.` }); break; @@ -45398,8 +45397,7 @@ try { break; case "closed": { const comment2 = (await octokit.rest.issues.listComments({ - owner: github.context.payload.repository?.owner.login ?? "", - repo: github.context.payload.repository?.name ?? "", + ...github.context.repo, issue_number: issue.number, mediaType: { format: "html" diff --git a/src/index.ts b/src/index.ts index 86ce3fd..9c9ff4d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -114,8 +114,7 @@ try { // create an issue comment so we can track if the task has been already created octokit.rest.issues.createComment({ issue_number: issue.number, - owner: context.payload.repository?.owner.login ?? "", - repo: context.payload.repository?.name ?? "", + ...context.repo, body: `Freelo task assigned: ${res.data.id}
Please do not edit or delete this comment as it is used to prevent duplication of tasks.`, }); break; @@ -127,8 +126,7 @@ try { // Get comments and find the related Freelo task ID const comment = ( await octokit.rest.issues.listComments({ - owner: context.payload.repository?.owner.login ?? "", - repo: context.payload.repository?.name ?? "", + ...context.repo, issue_number: issue.number, mediaType: { format: "html",