Bump actions/github to 2.2.0 to support GHES (#72)

* Bumping actions/github to 2.2.0

* Husky commit correct node modules
This commit is contained in:
PJ Quirk
2020-05-15 09:52:23 -04:00
committed by GitHub
parent 04aa5dbc72
commit c5c9bd0f54
7791 changed files with 2209804 additions and 49075 deletions

View File

@@ -1,23 +1,23 @@
module.exports = withAuthorizationPrefix
module.exports = withAuthorizationPrefix;
const atob = require('atob-lite')
const atob = require("atob-lite");
const REGEX_IS_BASIC_AUTH = /^[\w-]+:/
const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
function withAuthorizationPrefix (authorization) {
function withAuthorizationPrefix(authorization) {
if (/^(basic|bearer|token) /i.test(authorization)) {
return authorization
return authorization;
}
try {
if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
return `basic ${authorization}`
return `basic ${authorization}`;
}
} catch (error) { }
} catch (error) {}
if (authorization.split(/\./).length === 3) {
return `bearer ${authorization}`
return `bearer ${authorization}`;
}
return `token ${authorization}`
return `token ${authorization}`;
}