Skip to content

Commit 4366b4c

Browse files
committed
fix: fail if env variables are not added correctly
1 parent 8c0bb82 commit 4366b4c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/env/addEnv.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { exportVariable, addPath as ghAddPath, info } from "@actions/core"
1+
import { exportVariable, addPath as ghAddPath, info, setFailed } from "@actions/core"
22
import { isGitHubCI } from "./isci"
33
import { untildify_user as untildify } from "../path/untildify"
44
import { appendFileSync, existsSync, readFileSync } from "fs"
@@ -21,7 +21,7 @@ export function addEnv(name: string, val: string | undefined) {
2121
} catch (err2) {
2222
error(err2 as Error)
2323
}
24-
error(`Failed to export environment variable ${name}=${val}. You should add it manually.`)
24+
setFailed(`Failed to export environment variable ${name}=${val}. You should add it manually.`)
2525
}
2626
}
2727

@@ -41,7 +41,7 @@ export function addPath(path: string) {
4141
} catch (err2) {
4242
error(err2 as Error)
4343
}
44-
error(`Failed to add ${path} to the percistent PATH. You should add it manually.`)
44+
setFailed(`Failed to add ${path} to the percistent PATH. You should add it manually.`)
4545
}
4646
}
4747

0 commit comments

Comments
 (0)