Fix license check job

Change-Id: I64fc524650b38fbaed75fd0b1cd7b7bdbc677fb8
diff --git a/Jenkinsfile-mcord-license-check b/Jenkinsfile-mcord-license-check
index 4b75770..1b41adc 100644
--- a/Jenkinsfile-mcord-license-check
+++ b/Jenkinsfile-mcord-license-check
@@ -18,14 +18,6 @@
             stage ("Cleanup") {
                 sh returnStdout: true, script: "rm -rf *"
             }
-            stage ("Add private keys") {
-                withCredentials([sshUserPrivateKey(credentialsId: '315e1f56-7193-464e-8af1-97bf7b1ee541', keyFileVariable: 'KEY')]) {
-                    sh returnStdout: true, script: """
-                    chmod 600 $KEY && eval `ssh-agent -s` && ssh-add $KEY &&
-                    ssh-keyscan github.com >> ~/.ssh/known_hosts
-                    """
-                }
-            }
             for(int i=0; i < repos.size(); i++) {
                 stage ("Check repos ${repos[i]}") {
                     checkRepo(repos[i])
@@ -41,9 +33,13 @@
 }
 
 def checkRepo(repo) {
-        sh returnStdout: true, script: """
+        withCredentials([sshUserPrivateKey(credentialsId: '315e1f56-7193-464e-8af1-97bf7b1ee541', keyFileVariable: 'KEY')]) {
+            sh returnStdout: true, script: """
+            chmod 600 $KEY && eval `ssh-agent -s` && ssh-add $KEY &&
+            ssh-keyscan github.com >> ~/.ssh/known_hosts
             git clone -b ${branch} git@github.com:omec-project/${repo}.git
-        """
+            """
+        }
         hub_detect("--detect.source.path=${repo} --detect.project.name=${prefix}-${repo} --detect.project.version.name=${branch} --snippet-matching --full-snippet-scan")
 }