mirror of
https://github.com/github/codeql-action
synced 2026-05-25 15:00:36 +03:00
Fix warning for PAT-like token with username
This commit is contained in:
Generated
+4
-1
@@ -121817,7 +121817,10 @@ function getCredentials(logger, registrySecrets, registriesCredentials, language
|
||||
);
|
||||
}
|
||||
}
|
||||
if ((!hasUsername(authConfig) || !isDefined2(authConfig.username)) && isUsernamePassword(authConfig) && isDefined2(authConfig.password) && isPAT(authConfig.password) || isToken(authConfig) && isDefined2(authConfig.token) && isPAT(authConfig.token)) {
|
||||
const noUsername = !hasUsername(authConfig) || !isDefined2(authConfig.username);
|
||||
const passwordIsPAT = isUsernamePassword(authConfig) && isDefined2(authConfig.password) && isPAT(authConfig.password);
|
||||
const tokenIsPAT = isToken(authConfig) && isDefined2(authConfig.token) && isPAT(authConfig.token);
|
||||
if (noUsername && (passwordIsPAT || tokenIsPAT)) {
|
||||
logger.warning(
|
||||
`A ${e.type} private registry is configured for ${e.host || e.url} using a GitHub Personal Access Token (PAT), but no username was provided. This may not work correctly. When configuring a private registry using a PAT, select "Username and password" and enter the username of the user who generated the PAT.`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user