Skip to content

Commit

Permalink
Merge pull request #7 from andybelltree/add-skip-empty-post-option
Browse files Browse the repository at this point in the history
Move substring after checking for undefined
  • Loading branch information
andybelltree authored Aug 29, 2022
2 parents 172c98d + b6351d3 commit 6ae0eb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23174,10 +23174,12 @@ async function main$1() {

const lcov = await parse$2(raw);
const baselcov = baseRaw && (await parse$2(baseRaw));
const body = diff(lcov, baselcov, options).substring(0, MAX_COMMENT_CHARS);
let body = diff(lcov, baselcov, options);
if (!body) {
console.log(`No changed files in report, exiting...`);
return
} else {
body = body.substring(0, MAX_COMMENT_CHARS);
}

if (shouldDeleteOldComments) {
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ async function main() {

const lcov = await parse(raw)
const baselcov = baseRaw && (await parse(baseRaw))
const body = diff(lcov, baselcov, options).substring(0, MAX_COMMENT_CHARS)
let body = diff(lcov, baselcov, options)
if (!body) {
console.log(`No changed files in report, exiting...`)
return
} else {
body = body.substring(0, MAX_COMMENT_CHARS)
}

if (shouldDeleteOldComments) {
Expand Down

0 comments on commit 6ae0eb6

Please sign in to comment.