fix(app/gitform): check if authentication is enabled before using form credentials (#8722)

pull/8439/head
LP B 2 years ago committed by GitHub
parent 9567072ce0
commit d340c4ea96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -51,7 +51,7 @@ export async function checkRepo(
const { creds = {} } = options; const { creds = {} } = options;
// If no credentials were provided alter error from git to indicate repository is not found or is private // If no credentials were provided alter error from git to indicate repository is not found or is private
if ( if (
!(creds.username && creds.password) && (!(creds.username && creds.password) || !creds.gitCredentialId) &&
details === details ===
'authentication failed, please ensure that the git credentials are correct' 'authentication failed, please ensure that the git credentials are correct'
) { ) {

@ -11,6 +11,10 @@ export function getAuthentication(
| 'RepositoryGitCredentialID' | 'RepositoryGitCredentialID'
> >
) { ) {
if (!model.RepositoryAuthentication) {
return undefined;
}
if (model.RepositoryGitCredentialID) { if (model.RepositoryGitCredentialID) {
return { gitCredentialId: model.RepositoryGitCredentialID }; return { gitCredentialId: model.RepositoryGitCredentialID };
} }

@ -1,2 +1,3 @@
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=

Loading…
Cancel
Save