Skip to content

Commit

Permalink
clean error output
Browse files Browse the repository at this point in the history
  • Loading branch information
Astisme committed Jan 2, 2025
1 parent 641139e commit f9fa254
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,20 @@ jobs:
// Read the linter error output
const errorOutput = fs.readFileSync('lint-error.log', 'utf8');
if (!errorOutput) {
console.log("No lint errors.");
return;
}
// Remove ANSI codes
const cleanErrorOutput = str.replace(/\x1b\[[0-9;]*m/g;, '');
// Create a comment on the PR with the error message
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## Linter Failed:\n\n\`\`\`${errorOutput}\`\`\``
body: `## Linter Failed:\n\n\`\`\`${cleanErrorOutput}\`\`\``
});
- name: Remove lint-error.log
Expand Down

0 comments on commit f9fa254

Please sign in to comment.