testboard: use https URLs

The test runner does not have ssh access to GitHub, so can't use
ssh:// URLs. This means the tested revisions need to be public, but
since this is meant for foundation use, that should be fine.

(The testboard itself is public anway)

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
Gerwin Klein 2021-08-16 09:15:08 +10:00 committed by Gerwin Klein
parent 6bb3f6e64f
commit afdcbf13ee
1 changed files with 5 additions and 2 deletions

View File

@ -53,12 +53,15 @@ def subprocess_output(*args, **kwargs):
return out
# github remotes are of the form git@github.com:user/repo
# but repo expects an ssh URL, e.g. ssh://git@github.com/user/repo
# but repo expects an URL, e.g. ssh://git@github.com/user/repo
# Since the test runner will not have ssh permissions to github,
# we use a https URL instead -- this means the target repo needs
# to be public.
def fixup_github(remote):
git_url = 'git@github.com:'
url, repo = remote
if url.startswith(git_url):
return 'ssh://git@github.com/' + url[len(git_url):], repo
return 'https://github.com/' + url[len(git_url):], repo
else:
return remote