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

Set the pull request number as an environment variable

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Not A Defect
    • Icon: Major Major
    • ghprb-plugin
    • None

      To get the PR number that triggered the build you have to do a hack like,

      curl -sO $BUILD_URL/consoleText
      GITHUB_PR_NUMBER=$(head -1 consoleText | sed 's/.*pull request #\([0-9]*\) of.*/\1/')
      echo "GITHUB_PR_NUMBER = $GITHUB_PR_NUMBER"
      

      It would be much better if the GitHub Pull Request Builder Plugin just set an environment variable like GITHUB_PR_NUMBER to the PR number.

            janinko Honza Brázdil
            everett_toews Everett Toews
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: