codecov-action
codecov-action copied to clipboard
v2 Error: Expected a string but received a Array
Today I experienced the same problem as https://github.com/codecov/codecov-action/issues/561, however, migrating from v1 to v2 did not help me. Instead, I get a new error with the uploader exiting with code 255:
[2021-10-25T17:54:04.067Z] ['verbose'] The error stack is: TypeError: Expected a string but received a Array
at assertString (/snapshot/repo/node_modules/validator/lib/util/assertString.js:17:11)
at Object.isAlphanumeric (/snapshot/repo/node_modules/validator/lib/isAlphanumeric.js:18:29)
at validateToken (/snapshot/repo/dist/src/helpers/validate.js)
at getToken (/snapshot/repo/dist/src/helpers/token.js)
at main (/snapshot/repo/dist/src/index.js)
at Object.<anonymous> (/snapshot/repo/dist/bin/codecov.js)
at Module._compile (pkg/prelude/bootstrap.js:1794:22)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[2021-10-25T17:54:04.067Z] ['verbose'] End of uploader: 13 milliseconds
Error: Codecov: Failed to properly upload: The process '/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov' failed with exit code 255
The codecov block in my yaml
looks like this:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
name: ${{ matrix.python }} - ${{ matrix.install_extras }}
env_vars: OS,PYTHON
fail_ci_if_error: true
verbose: true
I have this error as well.
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
file: ./coverage.xml
flags: tests
name: ${{ matrix.py }} - ${{ matrix.os }}
verbose: true
Any updates on this? v3
and master
also fail while v1
works just fine.
I have the same question when I use it by docker on windows. How to solve it.
I'm going to close this out as there isn't enough information to debug. My best guess is that one of the arguments being passed into name
is an array and not a string. If you are still running into the issue, please open a topic in our community boards
I also ran into this issue when using the CircleCI Codecov orb and invoking codecov/upload
from a matrixed job. Same stack trace as well when in verbose mode.
I don't think the name
is a factor, as the stack trace seems to imply that it failed the validation of the token.
I wonder if this is an issue with the use of matrices and the uploader? @thomasrockhu-codecov