github-pr-coverage-status-plugin
github-pr-coverage-status-plugin copied to clipboard
Fix how URL is detected for a PR
This mostly boils down to removing PULL/ID from USER/REPO/PULL/ID.
All the other changes are debugging messages so it's easier to follow the logic.
This a possible fix for #39 and #42
My pipeline now contains the following statements:
...
currentBuild.result = 'SUCCESS'
try {
echo "In PR"
step([$class: 'CompareCoverageAction', scmVars: [GIT_URL: "https://github.com/mobilityhouse/testci",])
} catch (error) {
echo "Not in PR"
echo error.getMessage()
}
post {
success {
script {
if (env.BRANCH_NAME == 'master') {
step([$class: 'MasterCoverageAction',
scmVars:
[GIT_URL: "https://github.com/mobilityhouse/testci",]
])
echo 'hura!'
}
}
}