Repository: codecov/uploader (ts)

Issue:
Uploads to Service Travis CI Fail With Status Code 400
**Describe the bug**
Uploads to Travis CI fail.

**To Reproduce**
1. Go to https://travis-ci.com/github/tagatac/bagoup/builds/235325025#L340
2. Click on the arrow next to line 296
3. Scroll down to line 340
4. See error `Error uploading to Codecov when fetching PUT (inner): 400 Invalid request parameters`

**Expected behavior**
The coverage report is uploaded and processed without issue.

**Additional context**
See for comparison a successful upload of the same report, disguised as a local CI provider by unsetting the environment variable `CI`: https://travis-ci.com/github/tagatac/bagoup/builds/235324541

Note in the failing example `pr=NaN` could be problematic.

Pull request description:
Convert NaN PR numbers to the empty string
Fixes #301 

Linux binary tested [here](https://app.travis-ci.com/github/tagatac/bagoup/builds/236026747) and looks good:
```
[2021-08-23T19:39:44.624Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=uploader-0.1.0&token=*******&branch=codecov-400&build=33.1&build_url=&commit=a3c175b59f8ed4541457c911c36ecd1dc039ea1b&job=533308429&pr=&service=travis&slug=tagatac/bagoup&name=&tag=&flags=&parent=
[2021-08-23T19:39:44.900Z] ['info'] Uploading...
[2021-08-23T19:39:45.067Z] ['info'] {"status":"success","resultURL":"https://codecov.io/github/tagatac/bagoup/commit/a3c175b59f8ed4541457c911c36ecd1dc039ea1b"}
```

Patch:
diff --git a/src/helpers/web.ts b/src/helpers/web.ts
index 50dbb29..82c375f 100644
--- a/src/helpers/web.ts
+++ b/src/helpers/web.ts
@@ -111,7 +111,7 @@ export async function uploadToCodecov(
  */
 export function generateQuery(queryParams: IServiceParams): string {
   checkValueType('pr', queryParams.pr, 'number')
-  if (queryParams.pr === 0) {
+  if (queryParams.pr === 0  || isNaN(Number(queryParams.pr))) {
     queryParams.pr = ''
   }
   return Object.entries(queryParams)


Test patch:
diff --git a/test/helpers/web.test.ts b/test/helpers/web.test.ts
index 9ababdb..72af2bc 100644
--- a/test/helpers/web.test.ts
+++ b/test/helpers/web.test.ts
@@ -93,6 +93,25 @@ describe('Web Helpers', () => {
     )
   })
 
+  it('NaN PR numbers are not propagated to the query', () => {
+    const queryParams: IServiceParams  = {
+      branch: 'testBranch',
+      commit: 'commitSHA',
+      build: '4',
+      buildURL: 'https://ci-providor.local/job/xyz',
+      name: 'testName',
+      tag: 'tagV1',
+      slug: 'testOrg/testRepo',
+      service: 'testingCI',
+      flags: 'unit,uploader',
+      pr: NaN,
+      job: '6',
+    }
+    expect(generateQuery(queryParams)).toBe(
+      'branch=testBranch&commit=commitSHA&build=4&build_url=https://ci-providor.local/job/xyz&name=testName&tag=tagV1&slug=testOrg/testRepo&service=testingCI&flags=unit,uploader&pr=&job=6',
+    )
+  })
+
   it('can populateBuildParams() from args', () => {
     const result = populateBuildParams(
       { args: { flags: 'testFlag', tag: 'testTag' }, environment: {} },