@@ -222,36 +222,27 @@ async function main() {
222222
223223 // Did any languages just complete a build?
224224 for ( const lang of Object . keys ( outcomes ) ) {
225- // const commit = outcomes[lang].commit?.completed?.commit;
226-
227- console . log ( `COMMIT: ${ lang } : ${ JSON . stringify ( outcomes [ lang ] . commit , null , 2 ) } ` ) ;
228- // console.log(`COMMIT: ${lang}: ${JSON.stringify(baseOutcomes?.[lang].commit, null, 2)}`);
229-
230225 const commit = outcomes [ lang ] . commit ?. completed ?. commit ;
231- if ( commit && shouldGenerateAiCommitMessage ) {
232- // const commit = outcomes[lang].commit.completed.commit;
226+ const baseCommit = baseOutcomes ?. [ lang ] ?. commit ?. completed ?. commit ;
227+
228+ if ( commit && baseCommit && shouldGenerateAiCommitMessage ) {
229+ const baseRef = baseCommit . sha ;
230+ const headRef = commit . sha ;
233231
234- // const outcome = outcomes[lang];
235- // console.log(
236- // `\nBUILD COMPLETED FOR ${lang}:\n ${JSON.stringify(outcome, null, 2)}\n`,
237- // );
238232 console . log (
239233 `\nBUILD COMPLETED FOR ${ lang } ! SHA is ${ commit . sha } \n` ,
240234 ) ;
241235
242- const baseRef = "base" ;
243- const headRef = commit . sha ;
244- // commitMessages[lang] =
245- // (await generateAiCommitMessage(stainless, {
246- // target: lang,
247- // baseRef,
248- // headRef,
249- // })) || commitMessage;
236+ commitMessages [ lang ] =
237+ ( await generateAiCommitMessage ( stainless , {
238+ project : projectName ,
239+ target : lang ,
240+ baseRef,
241+ headRef,
242+ } ) ) || commitMessage ;
250243 }
251244 }
252245
253- // console.log(latestRun.outcomes);
254-
255246 // Use default message for any SDKs missing from comment (initial state for new comments)
256247 for ( const lang of Object . keys ( outcomes ) ) {
257248 if ( ! commitMessages [ lang ] ) {
0 commit comments