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

Environment variables tag name and branch name set incorrectly

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • git-plugin
    • None
    • Jenkins jenkins-2.187-1.1
      Git-plugin 4.0.0-rc

      In a multi-branch pipeline, if you commit to the master branch and print out the values of the environments variables you will see:

      BRANCH_NAME = master
      GIT_BRANCH = master

      If you trigger a build via committing a tag to the same repository and print out the variables (where the tag name is 4.1.0):

      BRANCH_NAME = 4.1.0
      GIT_BRANCH = 4.1.0
      TAG_NAME = 4.1.0

      I believe the correct values for the tagged build should be:

      BRANCH_NAME = master
      GIT_BRANCH = master
      TAG_NAME = 4.1.0

            markewaite Mark Waite
            michaelperzel MICHAEL PERZEL
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: