anc95 / anc95/ChatGPT-CodeReview
Avoid hardcoded secrets name when checking OpenAI API Key
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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