From be672d0856dd7a9d20e12ce034ab6b92ffaacfe6 Mon Sep 17 00:00:00 2001 From: nicholas-codecov Date: Mon, 9 Dec 2024 12:19:41 -0500 Subject: [PATCH] fix: Resolve issues with the Local Provider (#226) --- .changeset/little-dryers-switch.md | 15 +++++++++++++++ .../src/utils/providers/Local.ts | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .changeset/little-dryers-switch.md diff --git a/.changeset/little-dryers-switch.md b/.changeset/little-dryers-switch.md new file mode 100644 index 00000000..e71c1d15 --- /dev/null +++ b/.changeset/little-dryers-switch.md @@ -0,0 +1,15 @@ +--- +"@codecov/bundler-plugin-core": patch +"@codecov/astro-plugin": patch +"@codecov/bundle-analyzer": patch +"@codecov/nextjs-webpack-plugin": patch +"@codecov/nuxt-plugin": patch +"@codecov/remix-vite-plugin": patch +"@codecov/rollup-plugin": patch +"@codecov/solidstart-plugin": patch +"@codecov/sveltekit-plugin": patch +"@codecov/vite-plugin": patch +"@codecov/webpack-plugin": patch +--- + +Resolve issue with Local provider conditional check not being able to detect local values diff --git a/packages/bundler-plugin-core/src/utils/providers/Local.ts b/packages/bundler-plugin-core/src/utils/providers/Local.ts index f3a721b3..175f493a 100644 --- a/packages/bundler-plugin-core/src/utils/providers/Local.ts +++ b/packages/bundler-plugin-core/src/utils/providers/Local.ts @@ -37,7 +37,7 @@ function _getBranch( ): ProviderServiceParams["branch"] { const { args, envs } = inputs; const branch = args?.branch ?? envs?.GIT_BRANCH ?? envs?.BRANCH_NAME ?? null; - if (branch !== "") { + if (branch !== "" && branch !== null) { debug(`Using branch: ${branch}`, { enabled: output.debug }); return branch; } @@ -91,7 +91,7 @@ function _getSHA( ): ProviderServiceParams["commit"] { const { args, envs } = inputs; const sha = args?.sha ?? envs?.GIT_COMMIT ?? null; - if (sha !== "") { + if (sha !== "" && sha !== null) { debug(`Using commit: ${sha}`, { enabled: output.debug }); return sha; }