Skip to content

Commit 3910fd0

Browse files
committed
chore: address PR comment
1 parent f638c0e commit 3910fd0

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

services/apps/script_executor_worker/src/bin/onboard-projects.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,20 @@ async function onboardProjectsFromCsv(
141141
failedProjects.push({ ...project, reason: 'project creation' })
142142
}
143143

144-
try {
145-
// Create GitHub integration
146-
await createGithubIntegration(project, segmentId, bearerToken)
147-
log.info(`Created GitHub integration for project ${project.name}`)
148-
149-
successCount++
150-
} catch (error) {
151-
const errorMsg = `Failed to process project ${project.name}: ${error.message}`
152-
log.error(error, errorMsg)
153-
errors.push(errorMsg)
154-
failedProjects.push({ ...project, reason: 'integration creation' })
144+
// Don't create integration if project creation failed
145+
if (segmentId) {
146+
try {
147+
// Create GitHub integration
148+
await createGithubIntegration(project, segmentId, bearerToken)
149+
log.info(`Created GitHub integration for project ${project.name}`)
150+
151+
successCount++
152+
} catch (error) {
153+
const errorMsg = `Failed to process project ${project.name}: ${error.message}`
154+
log.error(error, errorMsg)
155+
errors.push(errorMsg)
156+
failedProjects.push({ ...project, reason: 'integration creation' })
157+
}
155158
}
156159

157160
// Wait 15 seconds before processing next project (except for the last one)

0 commit comments

Comments
 (0)