Skip to content

Commit b4c5d0a

Browse files
Alphy11thomas williams
and
thomas williams
authored
fix: add logging for when ssh falls back to http (#1639)
Co-authored-by: thomas williams <[email protected]>
1 parent c982249 commit b4c5d0a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/get-git-auth-url.js

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const {parse, format} = require('url'); // eslint-disable-line node/no-deprecate
22
const {isNil} = require('lodash');
33
const hostedGitInfo = require('hosted-git-info');
44
const {verifyAuth} = require('./git');
5+
const debug = require('debug')('semantic-release:get-git-auth-url');
56

67
/**
78
* Determine the the git repository URL to use to push, either:
@@ -42,8 +43,11 @@ module.exports = async ({cwd, env, branch, options: {repositoryUrl}}) => {
4243

4344
// Test if push is allowed without transforming the URL (e.g. is ssh keys are set up)
4445
try {
46+
debug('Verifying ssh auth by attempting to push to %s', repositoryUrl);
4547
await verifyAuth(repositoryUrl, branch.name, {cwd, env});
4648
} catch (_) {
49+
debug('SSH key auth failed, falling back to https.');
50+
4751
const envVar = Object.keys(GIT_TOKENS).find((envVar) => !isNil(env[envVar]));
4852
const gitCredentials = `${GIT_TOKENS[envVar] || ''}${env[envVar] || ''}`;
4953

0 commit comments

Comments
 (0)