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 1970db02..19cc0135 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,11 @@ 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" || context.eventName === "pull_request_target") { + if (shouldDeleteOldComments) { + await deleteOldComments(githubClient, options, context) + } + await githubClient.issues.createComment({ repo: context.repo.repo, owner: context.repo.owner,