Skip to content

feat: read GITHUB_TOKEN from a git-ignored .env file - #266

Open
soloturn wants to merge 1 commit into
masterfrom
fix/env-file-token
Open

soloturn wants to merge 1 commit into
masterfrom
fix/env-file-token

Conversation

@soloturn

Copy link
Copy Markdown
Contributor

AI-assisted change proposal. Filed by agent driven by @soloturn via GDD.

Summary

  • The module and issue loaders read GITHUB_TOKEN only from the process environment, and .env wasn't git-ignored, so a token file could be committed by accident.
  • .env is now ignored, and the loader reads it through Node's built-in process.loadEnvFile() when the variable is unset. No dotenv dependency.
  • README documents the .env option and GITHUB_TOKEN=$(gh auth token) npm run build.
  • Replaces install dotenv, fix gatsby-config.js, add .env to .gitignore #239, which targeted Gatsby files that no longer exist.

Test plan

  • With a fake token in .env, the build sends it (GitHub answers 401); without .env it warns "GITHUB_TOKEN not set"
  • astro check, ESLint and Prettier pass

Related

The loaders read only the process environment, and .env was not ignored, so a token file could be committed. Node's loadEnvFile reads it when GITHUB_TOKEN is unset; no dependency. README now shows the .env and `gh auth token` options. Replaces #239; refs #238.

Co-Authored-By: soloturn <soloturn@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 19592fa2-fdd1-4670-9507-57d519af9b9f
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant