anc95 / anc95/ChatGPT-CodeReview

Avoid hardcoded secrets name when checking OpenAI API Key

Open
#195 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
4.5k
Forks
461
PR merge metrics
No merged PRs in 30d

Description

Summary

I noticed that this tool assumed that OpenAI API Key is always stored in OPENAI_API_KEY secrets variable (https://github.com/anc95/ChatGPT-CodeReview/blob/dev/src/bot.ts#L21). I want to make this key can be stored with using flexible secrets variable name. This is recommended because the tool also initiated Chat object with OpenAI API Key fetched from environment variables, instead of directly to secrets variable (https://github.com/anc95/ChatGPT-CodeReview/blob/dev/src/bot.ts#L10).

This improvement should be good, because somehow the bot commented on the pull request indicating that I did not set OPENAI_API_KEY secrets variable (indeed I did not set it up, instead I set up the other variable). The PR can be seen on this link: https://github.com/stefanusgusega/sepotifai-retriever/pull/2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/bot.ts at the environment-variable use around lines 10 and 21, and compare how the Chat object and the secrets check obtain the API key. Determine the intended configuration for a flexible secret name, then update the behavior so both paths use it consistently. Done means a configured non-OPENAI_API_KEY secret is accepted without the misleading missing-key comment.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.