mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
22 lines
355 B
JavaScript
22 lines
355 B
JavaScript
|
module.exports = validateAuth;
|
||
|
|
||
|
function validateAuth(auth) {
|
||
|
if (typeof auth === "string") {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
if (typeof auth === "function") {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
if (auth.username && auth.password) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
if (auth.clientId && auth.clientSecret) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
|
||
|
}
|