Description
The API reads GITHUB_PERSONAL_ACCESS_TOKEN for GitHub GraphQL requests, but if the variable is missing or empty it still creates an authorization header like token undefined. This causes confusing downstream GitHub/Octokit errors instead of a clear configuration error.
Steps to Reproduce
- Run the API without setting GITHUB_PERSONAL_ACCESS_TOKEN in apps/api/.env
- Trigger project search / GitHub project fetching
- Observe the request fails with a less clear GitHub API error
Expected Behavior
The API should fail early with a clear message explaining that GITHUB_PERSONAL_ACCESS_TOKEN is required.
Actual Behavior
The API attempts the GitHub GraphQL request with an invalid authorization token.
Version
No response
Environment
Local development, API app
Additional Context
apps/api/.env.example marks GITHUB_PERSONAL_ACCESS_TOKEN as compulsory for the project search tool, so the runtime error should point contributors directly to that missing variable.
Description
The API reads GITHUB_PERSONAL_ACCESS_TOKEN for GitHub GraphQL requests, but if the variable is missing or empty it still creates an authorization header like
token undefined. This causes confusing downstream GitHub/Octokit errors instead of a clear configuration error.Steps to Reproduce
Expected Behavior
The API should fail early with a clear message explaining that GITHUB_PERSONAL_ACCESS_TOKEN is required.
Actual Behavior
The API attempts the GitHub GraphQL request with an invalid authorization token.
Version
No response
Environment
Local development, API app
Additional Context
apps/api/.env.example marks GITHUB_PERSONAL_ACCESS_TOKEN as compulsory for the project search tool, so the runtime error should point contributors directly to that missing variable.