-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: github-plugin
-
None
On the main github plugin page, https://plugins.jenkins.io/github/ we see this:
def getCommitSha() {
sh "git rev-parse HEAD > .git/current-commit"
return readFile(".git/current-commit").trim()
}
def updateGithubCommitStatus(build) {
// workaround https://issues.jenkins-ci.org/browse/JENKINS-38674
commitSha = getCommitSha()
// ...
Â
but when looking at the actual ticket, the last-reported comment which seems to solve an important issue for github-prs is to instead do:
def getCommitSha() {
sh "git show-ref -s $GIT_BRANCH > .git/current-commit"
return readFile(".git/current-commit").trim()
}
which... if the original ticket isn't getting fixed, appears to be the better workaround to put into your public-facing documentation.