Github has a maximum character limit for comments (seems to be about 65000 characters).
This is way too long to be useful, but we are generating some output that is longer than this.
Desired functionality:
- output to github commit comment first 20 errors only
- If more than 20 errors add a message (in bold) saying "more error messages exist, please refer to splunk report"
- same for warnings
code is here
git_comment=git_comment+'\n### ERRORS ('+errors.size()+')\n'
errors.each{ git_comment=git_comment+'\n'+it }
git_comment=git_comment+'\n### WARNINGS ('+warnings.size()+')\n'
warnings.each{ git_comment=git_comment+'\n'+it }
git_comment=git_comment.replaceAll("'","")
Actually, I am getting 200+ error messages to GitHub commit. I want to output only 20 error messages. Also, If more than 20 errors add a message (in bold) saying "more error messages exist, please refer to splunk report"
To make it output only 20 errors, I want ro know the syntax for errors.size() and warnings.size() in git_comment section of the code.