We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e5d6c3 commit 7828db7Copy full SHA for 7828db7
action.js
@@ -16,6 +16,11 @@ const replaceEnvVars = (str) => {
16
/\$\{([a-zA-Z0-9_]+):\+:\$[a-zA-Z0-9_]+\}/g,
17
(_, key) => ((v) => v ? `:${v}` : "")(process.env[key]),
18
)
19
+ // handles ${FOO:-bar} > $FOO || "bar"
20
+ .replaceAll(
21
+ /\$\{([a-zA-Z0-9_]+):-([^}]*)\}/g,
22
+ (_, key, defaultVal) => process.env[key] || defaultVal,
23
+ )
24
.replaceAll(/\$\{([a-zA-Z0-9_]+)\}/g, (_, key) => process.env[key] ?? "")
25
.replaceAll(/\$([a-zA-Z0-9_]+)/g, (_, key) => process.env[key] ?? "");
26
return value;
0 commit comments