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

Repository URL wrongly resolved #1733

Open
SheepFromHeaven opened this issue Jan 14, 2021 · 1 comment
Open

Repository URL wrongly resolved #1733

SheepFromHeaven opened this issue Jan 14, 2021 · 1 comment

Comments

@SheepFromHeaven
Copy link

SheepFromHeaven commented Jan 14, 2021

Current behavior

By passing no repositoryURL option and one malformed option to the cli and having a repository set in the package.json throws the error: ENOREPOURL.

Expected behavior

Wrongly set options passed to the cli and set repository url in the package json should throw a EWRONGOPTIONS error

Environment

  • semantic-release version: 17.3.2
  • CI environment: Local as well as as GITHUB Actions
  • CLI Options: semantic-release -tagFormat '${version}'

I traced the bug to the following code snippet:
https://github.com/semantic-release/semantic-release/blob/master/lib/get-config.js#L83

As the pickBy filters by nil, but the cliOptions return repositoryUrl as empty string on error, the repositoryUrl being correctly extrapolated from the package.json gets overwritten here.

@SheepFromHeaven SheepFromHeaven changed the title Repository URL wrongly resolved BREAKING: Repository URL wrongly resolved Jan 14, 2021
@SheepFromHeaven SheepFromHeaven changed the title BREAKING: Repository URL wrongly resolved Repository URL wrongly resolved Jan 14, 2021
@gr2m
Copy link
Member

gr2m commented Jan 15, 2021

so you say that we should also check for empty strings here?

// Remove `null` and `undefined` options so they can be replaced with default ones
...pickBy(options, (option) => !isNil(option)),

That makes sense, could you send a pull request please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants