Skip to content

Commit

Permalink
chore: test regex approach
Browse files Browse the repository at this point in the history
  • Loading branch information
robproject committed Oct 22, 2023
1 parent 168ba1a commit 0e06a53
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ jobs:
script: |
const fs = require('fs');
const output = fs.readFileSync('diff_output.html', 'utf8');
if (!output.trim()) { // Check if the output only contains whitespace
console.log("Output is empty or only contains whitespace. Skipping comment post.");
const regex = /<pre class="ansi2html-content">\s*<\/pre>/;
if (regex.test(output)) {
console.log("Output within <pre> tag is empty or only contains whitespace. Skipping comment post.");
return;
}
const issue_number = context.issue.number;
github.rest.issues.createComment({
owner: context.repo.owner,
Expand Down

0 comments on commit 0e06a53

Please sign in to comment.