-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OPENAI_API_KEY configuration error: Issues during GitHub Action execution #67
Comments
@julian-jeong is your pull request from one forked repo to the main repo? |
@anc95 This is pull request for the "a branch" that originated from the "main branch". Please refer to the attached image. |
@julian-jeong Your setup should be fine, I suggest creating a simple GitHub action demo to test it out, such as https://docs.github.com/en/actions/security-guides/encrypted-secrets#example-using-bash. |
Have you solved this problem? I seem to have encountered the same situation |
@XiaoRIGE It may not be a code bug, but rather some restrictions on the use of GitHub secrets. I am unable to reproduce it, so at the moment I have no idea how to assist with this. |
@anc95 it looks like here is the problem: Line 18 in 17cbc89
🔝 this code is executed even though it seems to be not needed. when this variable is added inside the repository, then the error is gone... no matter which value the variable has (does not need to be an api key) |
Lines 10 to 19 in 17cbc89
If OPEN_API_KEY is properly set, the code should go into the first if statement. However, it seems that the secret was not successfully injected to the environment when running the GitHub action. This has resulted in falling back to querying the OPENAI_API_KEY in the variable. Setting the key in the variable when using GitHub action integration is not recommended. This is because GitHub displays the variable in the action running log, which compromises security. |
@anc95 yeah i have seen that, but the interesting part is, that our so in fact "it is working", but we get that strange comment that the variable is not set. for us we have set up the |
This could also be a hint to the problem: the comment about "api key variable not set up" seem to be created via default |
@mralexandernickel it seems that you setup both GitHub action and GitHub app integrations. The warning comment is sent by GitHub app. So try to remove the GitHub app from your repo to see if it will be no warning in comment. |
🤦 exactly that has been the problem, thank you very much! I have removed the github app from our organization and instead only use the github action. now we got the behaviour we'd like to have 😊 sorry for my misunderstanding of setting up the integration, and thank you for your support and great work here! |
I have a problem with OPENAI_API_KEY not being recognized.
In the first attempt, I set the OPENAI_API_KEY variable in the Variables tab. The GitHub Action runs, but OPENAI_API_KEY is empty, and the error message says it cannot be found.

In the second attempt, I set up the YAML file like this and pushed it, but OPENAI_API_KEY is still empty.
Despite setting up the OPENAI_API_KEY in Actions secrets and variables, you are still encountering an issue where the OPENAI_API_KEY value is not being recognized.
Please tell me how to solve the problem.🥲
The text was updated successfully, but these errors were encountered: