mirror of
https://github.com/actions/setup-dotnet.git
synced 2024-11-23 20:11:07 +07:00
22 lines
350 B
JavaScript
22 lines
350 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)}`)
|
|
}
|