Add debug for GH importer

This commit is contained in:
Andras Bacsai
2022-03-22 09:35:24 +01:00
parent 1281a0f7e4
commit af99ea4678
3 changed files with 5 additions and 1 deletions

View File

@@ -45,6 +45,7 @@ export default async function ({
const { stdout: commit } = await asyncExecShell(`cd ${workdir}/ && git rev-parse HEAD`);
return commit.replace('\n', '');
} catch (error) {
console.log({ error });
return ErrorHandler(error);
}
}

View File

@@ -113,6 +113,9 @@ export default async function (job) {
deployKeyId: gitSource.gitlabApp?.deployKeyId || null,
privateSshKey: decrypt(gitSource.gitlabApp?.privateSshKey) || null
});
if (!commit) {
throw new Error('No commit found?');
}
let tag = commit.slice(0, 7);
if (pullmergeRequestId) {
tag = `${commit.slice(0, 7)}-${pullmergeRequestId}`;