From e78c7ee5e99e9c41b74bdece7fff42762c75a1fb Mon Sep 17 00:00:00 2001 From: kazvee <109990289+kazvee@users.noreply.github.com> Date: Wed, 1 Nov 2023 20:43:51 +0000 Subject: [PATCH] Run Prettier to resolve code style issues --- .github/workflows/issue-metrics.yml | 2 +- issue-metrics.js | 35 +++++++++++++++-------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/issue-metrics.yml b/.github/workflows/issue-metrics.yml index ec6fb6ab8..8405d8998 100644 --- a/.github/workflows/issue-metrics.yml +++ b/.github/workflows/issue-metrics.yml @@ -47,4 +47,4 @@ jobs: body: comment }) } - } \ No newline at end of file + } diff --git a/issue-metrics.js b/issue-metrics.js index 449bba66a..f3e029753 100644 --- a/issue-metrics.js +++ b/issue-metrics.js @@ -1,41 +1,42 @@ -const core = require('@actions/core'); -const github = require('@actions/github'); +const core = require('@actions/core') +const github = require('@actions/github') -const assignedIssues = {}; +const assignedIssues = {} const main = async () => { - const payload = JSON.parse(core.getInput('payload')); + const payload = JSON.parse(core.getInput('payload')) if (payload.action === 'assigned') { - const issue = payload.issue; - assignedIssues[issue.number] = issue.assignee.login; + const issue = payload.issue + assignedIssues[issue.number] = issue.assignee.login } if (payload.action === 'unlabeled' && payload.label.name === 'assigned') { - delete assignedIssues[payload.issue.number]; + delete assignedIssues[payload.issue.number] } if (payload.action === 'opened') { - const pull = payload.pull_request; - const issueNumber = pull.title.split('#')[1]; + const pull = payload.pull_request + const issueNumber = pull.title.split('#')[1] if (issueNumber && assignedIssues[issueNumber]) { - const timeDelta = new Date(pull.created_at) - new Date(assignedIssues[issueNumber]); + const timeDelta = + new Date(pull.created_at) - new Date(assignedIssues[issueNumber]) - const comment = `Time from assignment to PR for #${issueNumber}: ${timeDelta} ms`; + const comment = `Time from assignment to PR for #${issueNumber}: ${timeDelta} ms` - const octokit = github.getOctokit(core.getInput('github-token')); + const octokit = github.getOctokit(core.getInput('github-token')) await octokit.issues.createComment({ owner: github.context.repo.owner, repo: github.context.repo.repo, issue_number: pull.number, - body: comment, - }); + body: comment + }) } } -}; +} main().catch((error) => { - core.setFailed(error.message); -}); + core.setFailed(error.message) +})