You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jenkins Users
I've been trying to write a Jenkinsfile to do different tasks based on whether it's a PR or a merge in Jenkins 2. I've found the snippet below which will tell me if the build was triggered by a user or via Github. The problem is that if the build was started via a PR or a merge the reason is the same. Is there a better way to get this? Thanks!
def causes = currentBuild.rawBuild.getCauses()
for ( cause in causes) { echo "Cause: " + cause.getShortDescription() }
Jesse Glick
unread,
Aug 4, 2016, 11:12:00 AM8/4/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jenkins Users
On Wednesday, July 27, 2016 at 11:10:34 PM UTC-4, Shade Alabsa wrote:
I've been trying to write a Jenkinsfile to do different tasks based on whether it's a PR or a merge in Jenkins 2. I've found the snippet below which will tell me if the build was triggered by a user or via Github.
Not sure exactly what your situation is, but if you are using GitHub organization folders (or single multibranch projects), you should be able to just check `env.CHANGE_ID != null` to detect a PR build.