From 664ba9df474c609417b64c6c93d017478a03f503 Mon Sep 17 00:00:00 2001 From: Gert Hengeveld Date: Wed, 23 Aug 2023 17:05:07 +0200 Subject: [PATCH] Include all commit info in GitInfo and reorder the fields --- node-src/index.ts | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/node-src/index.ts b/node-src/index.ts index 5f7484d4a..5e3ff2327 100644 --- a/node-src/index.ts +++ b/node-src/index.ts @@ -114,31 +114,34 @@ export async function runAll(ctx, options?: Options) { } export type GitInfo = { - userEmail: string; - userEmailHash: string; + slug: string; branch: string; commit: string; - slug: string; + committedAt: number; + committerEmail: string; + committerName: string; uncommittedHash: string; + userEmail: string; + userEmailHash: string; }; export async function getGitInfo(): Promise { + const slug = await getSlug(); + const branch = await getBranch(); + const commitInfo = await getCommit(); const userEmail = await getUserEmail(); const userEmailHash = emailHash(userEmail); - const branch = await getBranch(); - const { commit } = await getCommit(); - const slug = await getSlug(); const [ownerName, repoName, ...rest] = slug ? slug.split('/') : []; const isValidSlug = !!ownerName && !!repoName && !rest.length; const uncommittedHash = await getUncommittedHash(); return { - userEmail, - userEmailHash, - branch, - commit, slug: isValidSlug ? slug : '', + branch, + ...commitInfo, uncommittedHash, + userEmail, + userEmailHash, }; }