mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-23 20:27:02 +08:00
adding 'env_vars' input option
This commit is contained in:
49885
dist/index.js
vendored
49885
dist/index.js
vendored
File diff suppressed because one or more lines are too long
10
index.js
10
index.js
@@ -9,6 +9,7 @@ try {
|
|||||||
const token = core.getInput("token");
|
const token = core.getInput("token");
|
||||||
const flags = core.getInput("flags");
|
const flags = core.getInput("flags");
|
||||||
const file = core.getInput("file");
|
const file = core.getInput("file");
|
||||||
|
const env_vars = core.getInput("env_vars");
|
||||||
fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
|
fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -62,6 +63,13 @@ try {
|
|||||||
options.env.CODECOV_TOKEN = token
|
options.env.CODECOV_TOKEN = token
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (let env_var of env_vars.split(',')) {
|
||||||
|
let env_var_clean = env_var.trim()
|
||||||
|
if (env_var_clean) {
|
||||||
|
options.env[env_var_clean] = process.env[env_var_clean]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const execArgs = ["codecov.sh"];
|
const execArgs = ["codecov.sh"];
|
||||||
if (file) {
|
if (file) {
|
||||||
execArgs.push(
|
execArgs.push(
|
||||||
@@ -92,7 +100,7 @@ try {
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
unlinkFile();
|
unlinkFile();
|
||||||
});;
|
});
|
||||||
|
|
||||||
const unlinkFile = () => {
|
const unlinkFile = () => {
|
||||||
fs.unlink("codecov.sh", err => {
|
fs.unlink("codecov.sh", err => {
|
||||||
|
|||||||
Reference in New Issue
Block a user