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

Please add a variable with last commit comment

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      It'd be nice to have a variable with the last commit message.

      Ex.:
      GIT_COMMENT = New commit message

          [JENKINS-33483] Please add a variable with last commit comment

          Mark Waite added a comment -

          The plugin environment variables already include the SHA1 of the most recent commit. Can't you obtain the message for the that commit with a command like:

          # Unix shell syntax
          git log $GIT_COMMIT^..$GIT_COMMIT
          

          Mark Waite added a comment - The plugin environment variables already include the SHA1 of the most recent commit. Can't you obtain the message for the that commit with a command like: # Unix shell syntax git log $GIT_COMMIT^..$GIT_COMMIT

          I could do that, if I needed this var in the builder step.
          However, I need it in 'slack notification plugin', which runs right after SCM step (I want to send last commit message in a slack notification when build starts)

          Lior Goikhburg added a comment - I could do that, if I needed this var in the builder step. However, I need it in 'slack notification plugin', which runs right after SCM step (I want to send last commit message in a slack notification when build starts)

            Unassigned Unassigned
            zerthimon Lior Goikhburg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: