Skip to content

Commit 229fef9

Browse files
fix: globalThis.gitClerkConfig creation including ghConfig (#143)
* hotfix: null check added to ghconfig * fix: stringy type check --------- Co-authored-by: silvester-pari <[email protected]>
1 parent 0bdc684 commit 229fef9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export async function initOctokit() {
2929
if (config) {
3030
configAuth =
3131
(config.githubAuthToken !== undefined &&
32-
(config.githubAuthToken === "string"
32+
(typeof config.githubAuthToken === "string" ||
33+
config.githubAuthToken instanceof String
3334
? config.githubAuthToken
3435
: await config.githubAuthToken())) ||
3536
import.meta.env.GITCLERK_GITHUB_TOKEN;
@@ -55,6 +56,7 @@ export async function initOctokit() {
5556
...config,
5657
config: { auth, username, repo: repoName },
5758
};
59+
if (!globalThis.gitClerkConfig) globalThis.gitClerkConfig = {};
5860
globalThis.gitClerkConfig.ghConfig = globalThis.ghConfig;
5961

6062
const octokit = new Octokit({ auth });

0 commit comments

Comments
 (0)