diff --git a/scripts/generate-index-json.ts b/scripts/generate-index-json.ts index 1e7d0cb..9097e4f 100644 --- a/scripts/generate-index-json.ts +++ b/scripts/generate-index-json.ts @@ -20,6 +20,7 @@ import type { Application, } from '../site/src/schema'; import { ParsedOrgFile, readOrgIndexFiles } from './orgFiles'; +import { execSync } from 'child_process'; const nordicOrgs: string[] = ['nrfconnect', 'nordic', 'nordicplayground']; const partnerOrgs: string[] = ['golioth']; @@ -29,7 +30,8 @@ function notUndefined(value: T | undefined): value is T { } function initialiseGitHubApi() { - const authToken = process.env.GITHUB_TOKEN; + const authToken = + process.env.GITHUB_TOKEN ?? execSync('gh auth token', { encoding: 'utf-8' }).trim(); if (!authToken) { throw new Error(