Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63938

Ability to access GH PR Comment Body during job triggered by PR Comment

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins 2.204.1
      github-pr-comment-build 2.1

      Building off of issue#22 filed on GitHub, it would be helpful if there was a way to access the GitHub comment body that triggered the build.  This is particularly helpful in the case where a single pipeline is building/testing many different pieces of a project and you would like to control through PR comments, the rebuilding of any specific piece.

      Ideally this would place the comment body in an environment variable accessible from within the build:

      env.GITHUB_PR_COMMENT

      But would be equally helpful to be able to access it through the trigger cause object:

      currentBuild.getRawBuild().causes[0].getCommentBody()

          [JENKINS-63938] Ability to access GH PR Comment Body during job triggered by PR Comment

          Brian Saville added a comment -

          The causes now works with your PR, I still haven't done anything with env vars, but you can open a separate issue for that if you'd still like it. I just don't have time to research what that would take at the moment.

          Brian Saville added a comment - The causes now works with your PR, I still haven't done anything with env vars, but you can open a separate issue for that if you'd still like it. I just don't have time to research what that would take at the moment.

            Unassigned Unassigned
            jebentier James Ebentier
            Votes:
            0 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: