1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 11:07:44 +00:00

GNU comment: Only display a comment if there is any (#4026)

* GNU comment: Only display a comment if there is any
This commit is contained in:
Sylvestre Ledru 2022-10-11 20:58:00 +02:00 committed by GitHub
parent fa17a94a73
commit d68dd23a56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,9 +44,15 @@ jobs:
script: | script: |
var fs = require('fs'); var fs = require('fs');
var issue_number = Number(fs.readFileSync('./NR')); var issue_number = Number(fs.readFileSync('./NR'));
var content = fs.readFileSync('./result.txt');
console.log(content);
console.log(content.trim());
console.log(content.trim().length);
if (content.trim().length > 7) { // 7 because we have backquote + \n
await github.issues.createComment({ await github.issues.createComment({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
issue_number: issue_number, issue_number: issue_number,
body: 'GNU testsuite comparison:\n```' + fs.readFileSync('./result.txt') + '\n```' body: 'GNU testsuite comparison:\n```' + content + '\n```'
}); });
}