Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only add --prefix when prefix option was specified. #131

Merged
merged 1 commit into from
Mar 18, 2020

Conversation

rwjblue
Copy link
Contributor

@rwjblue rwjblue commented Mar 15, 2020

@actions/cores getInput always returns a string (see implementation). Prior to these changes, the logic:

if (!coveragePrefix && typeof coveragePrefix === 'string') {

Would only pass the --prefix argument when the action was either configured with a prefix: "" or no prefix at all.

This changes to ensure that we only specify --prefix when a prefix option was specified. In the default case (no prefix option) the passed coveragePrefix would be "" which is falsey and would therefore avoid adding --prefix.

`@actions/core`s `getInput` **always** returns a string ([see
implementations](https://github.com/actions/toolkit/blob/%40actions/core%401.1.0/packages/core/src/core.ts#L72-L80).
Prior to these changes, the logic:

```js
if (!coveragePrefix && typeof coveragePrefix === 'string') {
```

Would only pass the `--prefix` argument when the action was *not*
configured with a `prefix` option.

This changes to ensure that we only specify `--prefix` when a `prefix`
option was specified. In the default case (no `prefix` option) the
passed `coveragePrefix` would be `""` which is falsey and would
therefore avoid adding `--prefix`.
@paambaati paambaati merged commit ef857a3 into paambaati:master Mar 18, 2020
@paambaati paambaati added the bug Something isn't working label Mar 18, 2020
@paambaati
Copy link
Owner

@rwjblue Thanks a lot for the PR! This has now landed in v2.5.5.

@rwjblue rwjblue deleted the only-add-prefix-when-needed branch March 18, 2020 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants