Skip to content

[BUG] : API sends invalid GitHub auth header when GITHUB_PERSONAL_ACCESS_TOKEN is missing #378

@adnankhan46

Description

@adnankhan46

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

  1. Run the API without setting GITHUB_PERSONAL_ACCESS_TOKEN in apps/api/.env
  2. Trigger project search / GitHub project fetching
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions