You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe your use-case which is not covered by existing documentation.
I recently came across this plugin and thought it would be a really useful way to launch different tasks via PR comments. As someone who is not intimately familiar with Jenkins pipeline scripting, it would have been really useful for me to see a short snippet of code showing how I would go about retrieving the comment body from the plugin. Especially since the correct way to retrieve build causes seems to have changed over the years. Not that I even knew that I needed to retrieve build causes when I started. I got there in the end with lots of confused Googling and many many failed builds.
To save other poor souls like me from hours of frustration, please could you put a quick example in the README?
I'm thinking something like this:
script {
def triggerCause = currentBuild.getBuildCauses("com.adobe.jenkins.github_pr_comment_build.GitHubPullRequestCommentCause")
if (triggerCause) {
echo("Author: ${triggerCause.commentAuthor}, Message: " +
"\"${triggerCause.commentBody}\"")
} else {
echo("Build was not started by a PR comment")
}
}
It's quite possible that's wrong, because I (still) don't really know what I'm doing. But you probably get the idea!
Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.
No response
The text was updated successfully, but these errors were encountered:
Describe your use-case which is not covered by existing documentation.
I recently came across this plugin and thought it would be a really useful way to launch different tasks via PR comments. As someone who is not intimately familiar with Jenkins pipeline scripting, it would have been really useful for me to see a short snippet of code showing how I would go about retrieving the comment body from the plugin. Especially since the correct way to retrieve build causes seems to have changed over the years. Not that I even knew that I needed to retrieve build causes when I started. I got there in the end with lots of confused Googling and many many failed builds.
To save other poor souls like me from hours of frustration, please could you put a quick example in the README?
I'm thinking something like this:
It's quite possible that's wrong, because I (still) don't really know what I'm doing. But you probably get the idea!
Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.
No response
The text was updated successfully, but these errors were encountered: