Skip to content
Permalink
Browse files

[JENKINS-40422] Use scanCredentials if available over checkoutCredent…

…ials

When you use a separate set of credentials for checkout and scanning
it makes sense to use the scan credentials to notify, for example it could
be that checkout credentials are of type SSH whilst scan are of type username/
password, or even that due to GH API limits both of them may be adecuate
but you want to use the scan ones
  • Loading branch information
raul-arabaolaza committed Dec 18, 2016
1 parent ecf5373 commit 77a59ad97a85ec7da331cba8b40d844a033d239e
@@ -409,7 +409,10 @@ private String getSha1() {
}

private String tryToInferCredentialsId() {
String credentialsID = getSource().getCredentialsId();
// Try to use scan credentials if available, if not fall back to checkout credentials
String checkoutCredentials = getSource().getCredentialsId();
String scanCredentials = getSource().getScanCredentialsId();
String credentialsID = scanCredentials == null ? scanCredentials : checkoutCredentials;
if (credentialsID != null) {
return credentialsID;
} else {

0 comments on commit 77a59ad

Please sign in to comment.
You can’t perform that action at this time.