mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-15 15:31:44 +00:00
add '-e' flag
This commit is contained in:
parent
d04135f7cf
commit
0e6a911c9b
1 changed files with 12 additions and 2 deletions
14
index.js
14
index.js
|
|
@ -63,14 +63,18 @@ try {
|
||||||
options.env.CODECOV_TOKEN = token
|
options.env.CODECOV_TOKEN = token
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('env_vars:', env_vars)
|
console.warn('env_vars:', env_vars)
|
||||||
|
const env_vars_arg = []
|
||||||
|
|
||||||
for (let env_var of env_vars.split(',')) {
|
for (let env_var of env_vars.split(",")) {
|
||||||
let env_var_clean = env_var.trim();
|
let env_var_clean = env_var.trim();
|
||||||
if (env_var_clean) {
|
if (env_var_clean) {
|
||||||
options.env[env_var_clean] = process.env[env_var_clean];
|
options.env[env_var_clean] = process.env[env_var_clean];
|
||||||
|
env_vars_arg.push(env_var_clean)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.warn('options.env:', options.env)
|
||||||
|
console.warn('env_vars_arg:', env_vars_arg)
|
||||||
|
|
||||||
const execArgs = ["codecov.sh"];
|
const execArgs = ["codecov.sh"];
|
||||||
if (file) {
|
if (file) {
|
||||||
|
|
@ -90,6 +94,12 @@ try {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (env_vars_arg.length) {
|
||||||
|
execArgs.push(
|
||||||
|
"-e", env_vars_arg.join(",")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
exec.exec("bash", execArgs, options)
|
exec.exec("bash", execArgs, options)
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
if (fail_ci) {
|
if (fail_ci) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue