Always use SSH checkouts in production jobs

This allows us to bypass Github rate-limits on anonymous checkouts.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
Change-Id: Ib9622c68fe78e37429be8dc08a6c4dd7dfbf2e3f
diff --git a/mbed-tls-nightly-tests.yaml b/mbed-tls-nightly-tests.yaml
index 28c2f77..5c4bc39 100644
--- a/mbed-tls-nightly-tests.yaml
+++ b/mbed-tls-nightly-tests.yaml
@@ -5,7 +5,7 @@
     name: mbed-tls-nightly-tests
     parameters:
     - string:
-        default: https://github.com/Mbed-TLS/mbedtls.git
+        default: ssh://git@github.com/Mbed-TLS/mbedtls.git
         description: Enter mbed TLS repo/fork
         name: MBED_TLS_REPO
         trim: 'false'
@@ -54,7 +54,7 @@
           example.
         name: TEST_MBED_OS_TLS_CLIENT_EXAMPLE
     - string:
-        default: https://github.com/ARMmbed/mbed-os.git
+        default: ssh://git@github.com/ARMmbed/mbed-os.git
         description: Enter the Mbed OS repo or fork
         name: MBED_OS_REPO
         trim: 'false'
@@ -67,7 +67,7 @@
         name: MBED_OS_BRANCH
         trim: 'false'
     - string:
-        default: https://github.com/ARMmbed/mbed-os-example-tls.git
+        default: ssh://git@github.com/ARMmbed/mbed-os-example-tls.git
         description: |-
           Enter the Mbed OS examples repo or fork.
 
@@ -113,7 +113,8 @@
       - git:
           branches:
           - main
-          url: https://github.com/Mbed-TLS/mbedtls-test.git
+          credentials-id: mbedtls-github-ssh
+          url: ssh://git@github.com/Mbed-TLS/mbedtls-test.git
       script-path: vars/mbedtls-release-Jenkinsfile
     project-type: pipeline
     properties:
@@ -135,7 +136,7 @@
         keep-system-variables: true
         load-from-master: false
         override-build-parameters: false
-        properties-content: GIT_CREDENTIALS_ID=mbedtls-github-token
+        properties-content: GIT_CREDENTIALS_ID=mbedtls-github-ssh
     triggers:
     - parameterized-timer:
         cron: |
diff --git a/mbed-tls-pr-head.yaml b/mbed-tls-pr-head.yaml
index be02109..23f25a3 100644
--- a/mbed-tls-pr-head.yaml
+++ b/mbed-tls-pr-head.yaml
@@ -16,9 +16,15 @@
                   <name>mbedtls-test</name>
                   <retriever class="org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever">
                     <scm class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source@2.9.1">
+                      <credentialsId>mbedtls-github-token</credentialsId>
                       <repoOwner>Mbed-TLS</repoOwner>
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
+                      <traits>
+                        <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
+                          <credentialsId>mbedtls-github-ssh</credentialsId>
+                        </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
+                      </traits>
                     </scm>
                   </retriever>
                   <defaultVersion>main</defaultVersion>
@@ -49,4 +55,6 @@
           disable: false
           recursive: true
           tracking: false
-          parent-credentials: false
+          parent-credentials: true
+        ssh-checkout:
+          credentials: mbedtls-github-ssh
diff --git a/mbed-tls-pr-merge.yaml b/mbed-tls-pr-merge.yaml
index 3bc2ac3..14dc9c2 100644
--- a/mbed-tls-pr-merge.yaml
+++ b/mbed-tls-pr-merge.yaml
@@ -16,9 +16,15 @@
                   <name>mbedtls-test</name>
                   <retriever class="org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever">
                     <scm class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source@2.9.1">
+                      <credentialsId>mbedtls-github-token</credentialsId>
                       <repoOwner>Mbed-TLS</repoOwner>
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
+                      <traits>
+                        <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
+                          <credentialsId>mbedtls-github-ssh</credentialsId>
+                        </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
+                      </traits>
                     </scm>
                   </retriever>
                   <defaultVersion>main</defaultVersion>
@@ -49,4 +55,6 @@
           disable: false
           recursive: true
           tracking: false
-          parent-credentials: false
+          parent-credentials: true
+        ssh-checkout:
+          credentials: mbedtls-github-ssh
diff --git a/mbed-tls-restricted-pr.yaml b/mbed-tls-restricted-pr.yaml
index 9f75bb0..66e7d8f 100644
--- a/mbed-tls-restricted-pr.yaml
+++ b/mbed-tls-restricted-pr.yaml
@@ -15,9 +15,15 @@
                   <name>mbedtls-test</name>
                   <retriever class="org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever">
                     <scm class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source@2.9.1">
+                      <credentialsId>mbedtls-github-token</credentialsId>
                       <repoOwner>Mbed-TLS</repoOwner>
                       <repository>mbedtls-test</repository>
                       <repositoryUrl>https://github.com/Mbed-TLS/mbedtls-test.git</repositoryUrl>
+                      <traits>
+                        <org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
+                          <credentialsId>mbedtls-github-ssh</credentialsId>
+                        </org.jenkinsci.plugins.github__branch__source.SSHCheckoutTrait>
+                      </traits>
                     </scm>
                   </retriever>
                   <defaultVersion>main</defaultVersion>
@@ -48,6 +54,6 @@
           disable: false
           recursive: true
           tracking: false
-          parent-credentials: false
+          parent-credentials: true
         ssh-checkout:
           credentials: mbedtls-github-ssh
diff --git a/mbedtls-gather-timestamps.yaml b/mbedtls-gather-timestamps.yaml
index 38db78b..eb8268c 100644
--- a/mbedtls-gather-timestamps.yaml
+++ b/mbedtls-gather-timestamps.yaml
@@ -9,7 +9,8 @@
       - git:
           branches:
           - main
-          url: https://github.com/Mbed-TLS/mbedtls-test.git
+          credentials-id: mbedtls-github-ssh
+          url: ssh://git@github.com/Mbed-TLS/mbedtls-test.git
       script-path: vars/mbedtls-gather-timestamps-Jenkinsfile
     project-type: pipeline
     properties:
diff --git a/mbedtls-restricted-release-new.yaml b/mbedtls-restricted-release-new.yaml
index 794e5bf..76a8db5 100644
--- a/mbedtls-restricted-release-new.yaml
+++ b/mbedtls-restricted-release-new.yaml
@@ -67,7 +67,7 @@
         name: MBED_CRYPTO_BRANCH
         trim: 'true'
     - string:
-        default: https://github.com/ARMmbed/mbed-os.git
+        default: ssh://git@github.com/ARMmbed/mbed-os.git
         description: Enter the Mbed OS repo or fork
         name: MBED_OS_REPO
         trim: 'true'
@@ -80,7 +80,7 @@
         name: MBED_OS_BRANCH
         trim: 'true'
     - string:
-        default: https://github.com/ARMmbed/mbed-os-example-tls.git
+        default: ssh://git@github.com/ARMmbed/mbed-os-example-tls.git
         description: |-
           Enter the Mbed OS examples repo or fork.
 
@@ -112,7 +112,8 @@
       - git:
           branches:
           - main
-          url: https://github.com/Mbed-TLS/mbedtls-test.git
+          credentials-id: mbedtls-github-ssh
+          url: ssh://git@github.com/Mbed-TLS/mbedtls-test.git
       script-path: vars/mbedtls-release-Jenkinsfile
     project-type: pipeline
     properties: