testboard: print GitHub commit URL

Useful for copy/paste into PR comments to link to the testboard
results, or just to see them manually.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
Gerwin Klein 2021-08-16 09:38:48 +10:00 committed by Gerwin Klein
parent 4cf76886f4
commit 34eaf81367
1 changed files with 4 additions and 1 deletions

View File

@ -306,8 +306,11 @@ def main(argv):
except subprocess.CalledProcessError:
fatal("Failed to push to test board.")
testboard_oneline = subprocess_output(['git', 'log', '--oneline'], cwd=testboard_repo).strip()
testboard_oneline = subprocess_output(['git', 'log', '--oneline', '-n', '1'], cwd=testboard_repo).strip()
short_sha = testboard_oneline.split(' ',1)[0]
log("Done. Your test board commit is:\n " + testboard_oneline)
if not args.dry_run:
log("Github link: https://github.com/seL4/gh-testboard/commit/" + short_sha)
finally:
shutil.rmtree(testboard_repo)