Skip to content

Commit 34ec720

Browse files
committed
Perform real env lookup
1 parent d35fed7 commit 34ec720

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/index.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,16 @@ async function run() {
313313
projectExists = false;
314314
}
315315

316-
// Check if environment exists (optional - won't fail if it doesn't)
316+
// Check if environment exists using EnvironmentsApi
317317
try {
318-
// This would need to be implemented based on your Quant Cloud API
319-
// For now, we'll assume it exists if we can get registry credentials
320-
// Note: This is a simplified check - in reality, you'd want to validate against actual environments
318+
core.info(`Checking if environment '${environmentName}' exists in application '${applicationName}'...`);
319+
const environment = await environmentsClient.getEnvironment(organization, applicationName, environmentName);
321320
environmentExists = true;
322-
core.info(`✅ Environment ${environmentName} validation successful (simplified check)`);
321+
core.info(`✅ Environment '${environmentName}' exists in Quant Cloud`);
323322
} catch (envError) {
324-
core.warning(`Environment ${environmentName} may not exist yet - this is normal for new projects`);
323+
const errorMessage = envError instanceof Error ? envError.message : 'Unknown error';
324+
core.info(`Environment '${environmentName}' does not exist yet - this is normal for new projects`);
325+
core.info(`You can create this environment in the Quant Cloud dashboard or it will be created automatically on first deployment`);
325326
environmentExists = false;
326327
}
327328

0 commit comments

Comments
 (0)