chore: reduce lines by using content of context.repo

This commit is contained in:
Matyáš Caras 2024-07-30 17:30:31 +02:00
parent 9c54baee5e
commit 4e1da0d79a
Signed by: hernik
GPG key ID: 2A3175F98820C5C6
2 changed files with 4 additions and 8 deletions

6
dist/index.js vendored
View file

@ -45388,8 +45388,7 @@ try {
} }
octokit.rest.issues.createComment({ octokit.rest.issues.createComment({
issue_number: issue.number, issue_number: issue.number,
owner: github.context.payload.repository?.owner.login ?? "", ...github.context.repo,
repo: github.context.payload.repository?.name ?? "",
body: `Freelo task assigned: <a href="https://app.freelo.io/task/${res.data.id}">${res.data.id}</a><br>Please do not edit or delete this comment as it is used to prevent duplication of tasks.` body: `Freelo task assigned: <a href="https://app.freelo.io/task/${res.data.id}">${res.data.id}</a><br>Please do not edit or delete this comment as it is used to prevent duplication of tasks.`
}); });
break; break;
@ -45398,8 +45397,7 @@ try {
break; break;
case "closed": { case "closed": {
const comment2 = (await octokit.rest.issues.listComments({ const comment2 = (await octokit.rest.issues.listComments({
owner: github.context.payload.repository?.owner.login ?? "", ...github.context.repo,
repo: github.context.payload.repository?.name ?? "",
issue_number: issue.number, issue_number: issue.number,
mediaType: { mediaType: {
format: "html" format: "html"

View file

@ -114,8 +114,7 @@ try {
// create an issue comment so we can track if the task has been already created // create an issue comment so we can track if the task has been already created
octokit.rest.issues.createComment({ octokit.rest.issues.createComment({
issue_number: issue.number, issue_number: issue.number,
owner: context.payload.repository?.owner.login ?? "", ...context.repo,
repo: context.payload.repository?.name ?? "",
body: `Freelo task assigned: <a href="https://app.freelo.io/task/${res.data.id}">${res.data.id}</a><br>Please do not edit or delete this comment as it is used to prevent duplication of tasks.`, body: `Freelo task assigned: <a href="https://app.freelo.io/task/${res.data.id}">${res.data.id}</a><br>Please do not edit or delete this comment as it is used to prevent duplication of tasks.`,
}); });
break; break;
@ -127,8 +126,7 @@ try {
// Get comments and find the related Freelo task ID // Get comments and find the related Freelo task ID
const comment = ( const comment = (
await octokit.rest.issues.listComments({ await octokit.rest.issues.listComments({
owner: context.payload.repository?.owner.login ?? "", ...context.repo,
repo: context.payload.repository?.name ?? "",
issue_number: issue.number, issue_number: issue.number,
mediaType: { mediaType: {
format: "html", format: "html",