git checkout master
TARGET_COMMIT_ID = sh 'git log -n 1'
echo '${TARGET_COMMIT_ID}'
In my Jenkins file i'm executing the above commands to print the commit i'd of the target branch. In runtime i'm seeing null value printing. what am i missing here ?
My expectation was to print the commit i'd in the output.