This works to fix the issue if run between the custom checkout and the sh that runs sonar-scanner:
env.GIT_COMMIT = sh 'git rev-parse HEAD'
This works to fix the issue if run between the custom checkout and the sh that runs sonar-scanner:
env.GIT_COMMIT = sh 'git rev-parse HEAD'