-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
BUG: verifyAuth should not try SSH in the presence of a token in the environment; and should not call debug()
#2053
Comments
debug()
We are in the process of trying to use this plugin, and run into this exact confusing message thinking we had done something wrong, when we haven't. So highly agree to fix this. |
@wlfbck I already provided the code, it was rejected. |
We are hitting this same issue as well, semantic release plugin tries to authenticate with SSH first. |
I just noticed this because one of my release workflows now takes 2 minutes longer than it used to. https://github.com/myparcelnl/js-sdk/runs/6387333718 / semantic-release took 15s :) Running |
It looks like the issue is in get-config.js repositoryUrl is either taken from package.json (repository or repository.url based on the setup) or from the result of In case you have https url set up in your package.json or you/CI cloned the repo using https then the value of repositoryUrl will be always with https. By the way https is the correct setup. See npm docs. repositoryUrl value is then used in get-git-auth-url.js with wrong assumption that it's SSH URL. Potential solutions:
|
@dawidbojarowicz try my fork. See if it solves your problem |
In CircleCI, for example, environment variables can be shared across projects using contexts. I may want to use some but not all env vars from a context in my workflow. Just because an env var with a certain name is present doesn't mean specific job should make implicit assumptions based on that fact. Especially when this takes precedence over the repositoryUrl format leaving the user with hacks (unset GH_TOKEN ...) |
I disagree with the framing of "implicit" there. Whether you're reading package.json as configuration or the environment as configuration, it's no more or less implicit. There are defaults either way. They're used implicitly. There are fall-backs currently. The only question is how these fall-backs should read package.json and environmental variables. In your case, you have environmental variables provided to a process that you want ignored. In my case, (forking workflow) I have a package.json which I want ignored (as it doesn't represent the forked package). I imagine my workflow is far more common, as 100% of forks encounter it and that's pretty common with a process built around Git. I'd also urge you to unset your tokens regardless. Supplying tokens to every process in your pipeline sounds like a bad idea. |
it looks like the issue still exists in version 20.1.0. Is there any updates here? |
If it helps anyone I was getting this issue and scratching my head for while until I ended up stumbling on the idea that the issue is with the
The key thing to note is this is running the |
Just as a reminder, the fork here solves this problem https://github.com/EvanCarroll/semantic-release |
There is a routine called
verifyAuth
, there are a few problems with this routine,two
_TOKEN
, why would we want to try ssh verification first?semantic-release/gitlab
Fail on git push --dry-run --no-verify: remote: HTTP Basic: Access denied gitlab#259 which was a mistake because the GitLab authentication and implementation ofverifyAuth
happens not in the GitLab module but in core. that means on that on the first call that I linked above, 100% of users (afaik) that use--debug
, GitLab, and CI tokens (rather than SSH keys) will receive a spurious message,debug(error)
in the call theverifyAuth()
, and to handle that from the caller's perspective. No one should turn on--debug
and see "remote: HTTP Basic: Access denied; fatal: Authentication failed" as a result of a pre-flight or fail over.If we agree on these implementation I can submit a patch.
The text was updated successfully, but these errors were encountered: