MCPcopy Index your code
hub / github.com/graphql/graphql-spec / getToken

Function getToken

scripts/generate-contributor-list.mjs:113–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111const REPO = repoNameWithOwner();
112const [OWNER, NAME] = REPO.split("/");
113function getToken() {
114 const env = process.env.GITHUB_TOKEN || process.env.GH_TOKEN || "";
115 if (env) return env;
116 try { return execFileSync("gh", ["auth", "token"], { encoding: "utf8" }).trim(); } catch { return ""; }
117}
118const TOKEN = getToken();
119if (!TOKEN) console.error("Warning: no GITHUB_TOKEN/GH_TOKEN (or gh auth token). Resolution will be limited.");
120

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected