Skip to content

Commit

Permalink
Error if pulumi version fails (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frassle authored Apr 11, 2024
1 parent 4cb2d06 commit 93f4ee6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/pulumi-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ export async function downloadCli(range: string): Promise<void> {
const versionExec = await exec.exec(`pulumi`, ['version'], true);
const pulumiVersion = versionExec.stdout.trim();
core.debug(`Running pulumi verison returned: ${pulumiVersion}`);

if (!versionExec.success) {
throw new Error(`Failed to verify pulumi version:\n${versionExec.stderr}`);
}

if (!semver.satisfies(pulumiVersion, version)) {
throw new Error(`Installed version "${pulumiVersion}" did not satisfy the resolved version "${version}"`);
}
Expand Down

0 comments on commit 93f4ee6

Please sign in to comment.