Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@ import dotenv from 'dotenv';

dotenv.config();

if (!process.env.GITHUB_TOKEN) {
// biome-ignore lint/suspicious/noConsole: CLI script output
console.warn(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a Biome ignore comment and we're good to go

'\x1b[33m⚠ GITHUB_TOKEN is not set. Skipping GraphQL codegen.\n' +
' To generate updated types, create a .env file with a valid GitHub PAT.\n' +
' See .env.template for details.\x1b[0m',
);
process.exit(0);
}

const config: CodegenConfig = {
overwrite: true,
schema: {
'https://api.github.com/graphql': {
// Add a custom header for authorization using your PAT
headers: {
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
},
Expand Down