Update index.mjs
This commit is contained in:
@@ -104,7 +104,7 @@
|
|||||||
info("Use mocked API", true)
|
info("Use mocked API", true)
|
||||||
}
|
}
|
||||||
//Test token validity
|
//Test token validity
|
||||||
else if (!/^(?:MOCKED_TOKEN|NOT_NEEDED)$/.test(token)) {
|
else if (!/^NOT_NEEDED$/.test(token)) {
|
||||||
const {headers} = await api.rest.request("HEAD /")
|
const {headers} = await api.rest.request("HEAD /")
|
||||||
if (!("x-oauth-scopes" in headers))
|
if (!("x-oauth-scopes" in headers))
|
||||||
throw new Error("GitHub API did not send any \"x-oauth-scopes\" header back from provided \"token\". It means that your token may not be valid or you're using GITHUB_TOKEN which cannot be used since metrics will fetch data outside of this repository scope. Use a personal access token instead (see https://github.com/lowlighter/metrics/blob/master/.github/readme/partials/setup/action/setup.md for more informations).")
|
throw new Error("GitHub API did not send any \"x-oauth-scopes\" header back from provided \"token\". It means that your token may not be valid or you're using GITHUB_TOKEN which cannot be used since metrics will fetch data outside of this repository scope. Use a personal access token instead (see https://github.com/lowlighter/metrics/blob/master/.github/readme/partials/setup/action/setup.md for more informations).")
|
||||||
|
|||||||
Reference in New Issue
Block a user