Skip to content
Snippets Groups Projects
Commit 653ee48a authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

getBuildInfo: also handle ssh remotes

Convert them to the matching https equivalent.
probably gitlab specific, but works for now..
parent 3da638e7
No related branches found
No related tags found
No related merge requests found
Pipeline #101877 passed
......@@ -9,6 +9,10 @@ export function getBuildInfo(build) {
let remote = child_process.execSync('git config --get remote.origin.url').toString().trim();
let commit = child_process.execSync('git rev-parse --short HEAD').toString().trim();
if (remote.indexOf('git@') === 0) {
remote = remote.replace(':', '/').replace('git@', 'https://');
}
let parsed = url.parse(remote);
let newPath = parsed.path.slice(0, parsed.path.lastIndexOf('.'));
let newUrl = parsed.protocol + '//' + parsed.host + newPath + '/commit/' + commit;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment