From 71d9e79612490aedf5977ebd5c08e3f8a869e0ca Mon Sep 17 00:00:00 2001 From: Klaus Badelt Date: Sun, 5 Mar 2023 14:26:30 -0800 Subject: [PATCH 1/2] fix RequestError [HttpError]: Empty value for parameter 'issue_number': undefined --- dist/main.js | 9 ++++----- src/index.js | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dist/main.js b/dist/main.js index e20b9568..160d61a7 100644 --- a/dist/main.js +++ b/dist/main.js @@ -23099,7 +23099,7 @@ const MAX_COMMENT_CHARS = 65536; async function main$1() { const token = core$1.getInput("github-token"); const githubClient = new github_2(token); - const workingDir = core$1.getInput('working-directory') || './'; + const workingDir = core$1.getInput('working-directory') || './'; const lcovFile = path.join(workingDir, core$1.getInput("lcov-file") || "./coverage/lcov.info"); const baseFile = core$1.getInput("lcov-base"); const shouldFilterChangedFiles = @@ -23148,11 +23148,10 @@ async function main$1() { const baselcov = baseRaw && (await parse$2(baseRaw)); const body = diff(lcov, baselcov, options).substring(0, MAX_COMMENT_CHARS); - if (shouldDeleteOldComments) { - await deleteOldComments(githubClient, options, github_1); - } - if (github_1.eventName === "pull_request") { + if (shouldDeleteOldComments) { + await deleteOldComments(githubClient, options, github_1); + } await githubClient.issues.createComment({ repo: github_1.repo.repo, owner: github_1.repo.owner, diff --git a/src/index.js b/src/index.js index 2efc5fb0..5f09855b 100644 --- a/src/index.js +++ b/src/index.js @@ -14,7 +14,7 @@ const MAX_COMMENT_CHARS = 65536 async function main() { const token = core.getInput("github-token") const githubClient = new GitHub(token) - const workingDir = core.getInput('working-directory') || './'; + const workingDir = core.getInput('working-directory') || './'; const lcovFile = path.join(workingDir, core.getInput("lcov-file") || "./coverage/lcov.info") const baseFile = core.getInput("lcov-base") const shouldFilterChangedFiles = @@ -63,11 +63,10 @@ async function main() { const baselcov = baseRaw && (await parse(baseRaw)) const body = diff(lcov, baselcov, options).substring(0, MAX_COMMENT_CHARS) - if (shouldDeleteOldComments) { - await deleteOldComments(githubClient, options, context) - } - if (context.eventName === "pull_request") { + if (shouldDeleteOldComments) { + await deleteOldComments(githubClient, options, context) + } await githubClient.issues.createComment({ repo: context.repo.repo, owner: context.repo.owner, From b1b91ae0d026dc70a33c5835d9257f1377ad1683 Mon Sep 17 00:00:00 2001 From: Klaus Badelt Date: Sat, 27 Jan 2024 08:15:39 -0600 Subject: [PATCH 2/2] Upgrade to Node 20 --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index fdeaf519..08d896d8 100644 --- a/action.yml +++ b/action.yml @@ -31,5 +31,5 @@ inputs: description: Title to add to the comment required: false runs: - using: node16 + using: 'node20' main: dist/main.js