From 246b48ed0ef4950261c58170e87d39d5b612fb5d Mon Sep 17 00:00:00 2001 From: Miguel Langarano Date: Wed, 10 Jan 2024 12:45:49 -0500 Subject: [PATCH] fix type --- packages/cypress-cloud/lib/api/types/run.ts | 3 ++- packages/cypress-cloud/lib/ciProvider.ts | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/cypress-cloud/lib/api/types/run.ts b/packages/cypress-cloud/lib/api/types/run.ts index 57b54e73..f6b33515 100644 --- a/packages/cypress-cloud/lib/api/types/run.ts +++ b/packages/cypress-cloud/lib/api/types/run.ts @@ -1,5 +1,6 @@ import { CiParams, CiProvider } from "cypress-cloud/lib/ciProvider"; import { Platform, ValidatedCurrentsParameters } from "cypress-cloud/types"; +import { GhaEventData } from "../../git"; export type CreateRunPayload = { ci: { @@ -10,7 +11,7 @@ export type CreateRunPayload = { projectId: string; recordKey: string; commit: { - [memoKey: string]: string | null; + [memoKey: string]: string | GhaEventData | null; }; specs: string[]; group?: string; diff --git a/packages/cypress-cloud/lib/ciProvider.ts b/packages/cypress-cloud/lib/ciProvider.ts index 8c6f5a35..6f7394c5 100644 --- a/packages/cypress-cloud/lib/ciProvider.ts +++ b/packages/cypress-cloud/lib/ciProvider.ts @@ -742,11 +742,14 @@ export function getCommitDefaults(existingInfo: CiProviderData) { const combined = _.transform( existingInfo, ( - memo: { [memoKey: string]: string | null }, + memo: { [memoKey: string]: string | GhaEventData | null }, value: string | GhaEventData, key: string ) => { - return (memo[key] = _.defaultTo(value || commitParamsObj[key], null)); + return (memo[key] = _.defaultTo( + value || commitParamsObj[key as keyof CiProvider], + null + )); } );