When using the GitHub Organization Folder, none of the builds have the CHANGE_* variables set.

      I have tried both sh 'env | sort' and echo "${env.CHANGE_ID}".

      I'm expecting these to be set:

      • CHANGE_ID
      • CHANGE_URL
      • CHANGE_TITLE
      • CHANGE_AUTHOR
      • CHANGE_AUTHOR_DISPLAY_NAME
      • CHANGE_AUTHOR_EMAIL
      • CHANGE_TARGET

          [JENKINS-39838] CHANGE_ variables are missing

          Christian Höltje created issue -
          Christian Höltje made changes -
          Description Original: When using the GitHub Organization Folder, none of the builds have the {{CHANGE_*}} variables set.

          I have tried both {{sh 'env | sort`}} and {{echo "${env.CHANGE_ID}"}}.
          New: When using the GitHub Organization Folder, none of the builds have the {{CHANGE_*}} variables set.

          I have tried both {{sh 'env | sort'}} and {{echo "${env.CHANGE_ID}"}}.

          I'm expecting these to be set:

          * {{CHANGE_ID}}
          * {{CHANGE_URL}}
          * {{CHANGE_TITLE}}
          * {{CHANGE_AUTHOR}}
          * {{CHANGE_AUTHOR_DISPLAY_NAME}}
          * {{CHANGE_AUTHOR_EMAIL}}
          * {{CHANGE_TARGET}}
          Christian Höltje made changes -
          Description Original: When using the GitHub Organization Folder, none of the builds have the {{CHANGE_*}} variables set.

          I have tried both {{sh 'env | sort'}} and {{echo "${env.CHANGE_ID}"}}.

          I'm expecting these to be set:

          * {{CHANGE_ID}}
          * {{CHANGE_URL}}
          * {{CHANGE_TITLE}}
          * {{CHANGE_AUTHOR}}
          * {{CHANGE_AUTHOR_DISPLAY_NAME}}
          * {{CHANGE_AUTHOR_EMAIL}}
          * {{CHANGE_TARGET}}
          New: When using the GitHub Organization Folder, none of the builds have the {{CHANGE_*}} variables set.

          I have tried both {{sh 'env | sort'}} and {{echo "$\{env.CHANGE_ID}"}}.

          I'm expecting these to be set:

          * {{CHANGE_ID}}
          * {{CHANGE_URL}}
          * {{CHANGE_TITLE}}
          * {{CHANGE_AUTHOR}}
          * {{CHANGE_AUTHOR_DISPLAY_NAME}}
          * {{CHANGE_AUTHOR_EMAIL}}
          * {{CHANGE_TARGET}}

          I want to point out the CHANGE_* variables ARE populated when then build is started from a pull request on a forked repository. When I attempt to create a branch on the main repository then create a pull request to merge into master, the variables are not populated (not entirely sure how it determines what a pull request "is" in that case).

          Andrew Turgeon added a comment - I want to point out the CHANGE_* variables ARE populated when then build is started from a pull request on a forked repository. When I attempt to create a branch on the main repository then create a pull request to merge into master, the variables are not populated (not entirely sure how it determines what a pull request "is" in that case).

          Could you please also add following variables:
          Source_branch
          Repository_owner (organization)
          repository_name
          sha (commit_sha)
          the last one is very important

          Viachaslau Kabak added a comment - Could you please also add following variables: Source_branch Repository_owner (organization) repository_name sha (commit_sha) the last one is very important

          Aidan Steele added a comment -

          maniax89 I was struggling with this as well and found that changing the configuration from Build origin branches also filed as PRs (default checked) to Build origin PRs (merged with base branch) was enough to get the env vars set in my jobs.

          Aidan Steele added a comment - maniax89 I was struggling with this as well and found that changing the configuration from Build origin branches also filed as PRs (default checked) to Build origin PRs (merged with base branch) was enough to get the env vars set in my jobs.

          Seems like this was a configuration error (that the configuration options are non-obvious is a separate issue)... Closing this issue in any case as with the 2.0 series of GitHub Branch Source the GitHub Organization Folders plugin is dead (functionality moved to GitHub Branch Source)

          Stephen Connolly added a comment - Seems like this was a configuration error (that the configuration options are non-obvious is a separate issue)... Closing this issue in any case as with the 2.0 series of GitHub Branch Source the GitHub Organization Folders plugin is dead (functionality moved to GitHub Branch Source)
          Stephen Connolly made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

          Like Guitar added a comment -

          I got same problems when sending 

          ${CHANGE_TITLE} ${CHANGE_AUTHOR} ${CHANGE_TARGET} ${CHANGE_AUTHOR_DISPLAY_NAME}
          

          with Chatwork Plugin

          I also tried this way too

          $CHANGE_TITLE $CHANGE_AUTHOR $CHANGE_TARGET $CHANGE_AUTHOR_DISPLAY_NAME
          

           

          Like Guitar added a comment - I got same problems when sending  ${CHANGE_TITLE} ${CHANGE_AUTHOR} ${CHANGE_TARGET} ${CHANGE_AUTHOR_DISPLAY_NAME} with Chatwork Plugin I also tried this way too $CHANGE_TITLE $CHANGE_AUTHOR $CHANGE_TARGET $CHANGE_AUTHOR_DISPLAY_NAME  

          > Seems like this was a configuration error (that the configuration options are non-obvious is a separate issue)

          No. It's more than that. I think something is wacky here.  It may just be the case that GitHub items should have different variables (e.g. PR_ vars) or something.

          My users (about 200 developers) are constantly tripping on this.  Some of the variables seem to imply they should always be set, instead of just for a PR.  e.g. If I push a new commit, shouldn't there be a record of the changes that triggered it?  Regardless of whether you are doing a "merged with base" or not.

          Christian Höltje added a comment - > Seems like this was a configuration error (that the configuration options are non-obvious is a separate issue) No. It's more than that. I think something is wacky here.  It may just be the case that GitHub items should have different variables (e.g. PR_ vars) or something. My users (about 200 developers) are constantly tripping on this.  Some of the variables seem to imply they should always be set, instead of just for a PR.  e.g. If I push a new commit, shouldn't there be a record of the changes that triggered it?  Regardless of whether you are doing a "merged with base" or not.

            kohsuke Kohsuke Kawaguchi
            docwhat Christian Höltje
            Votes:
            2 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: