Skip to content

Missing environment variable in GitHub workflow when creating a new project on Nuxthub #510

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

Open
maximepvrt opened this issue Mar 20, 2025 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@maximepvrt
Copy link

Describe the bug
When creating a new project on Nuxthub, I added environment variables through the project configuration. However, after the project was set up on GitHub, I noticed that NUXT_OAUTH_GOOGLE_CLIENT_ID was missing, while NUXT_OAUTH_GOOGLE_CLIENT_SECRET was correctly added.

Image

Expected behavior
All environment variables added in the Nuxthub configuration should be properly copied into the GitHub workflow.

@maximepvrt maximepvrt added the bug Something isn't working label Mar 20, 2025
@RihanArfan
Copy link
Collaborator

When linking a NuxtHub project to a GitHub repository, NuxtHub automatically copies all environment variables over from Cloudflare. Since secrets cannot be retrieved after being set, they cannot be automatically migrated.

I suspect you've added NUXT_OAUTH_GOOGLE_CLIENT_ID as a secret on Cloudflare. Could you double check from the Cloudflare dashboard under the Pages project settings -> variables (you can choose the environment from the top)?

@maximepvrt
Copy link
Author

I double-checked, and NUXT_OAUTH_GOOGLE_CLIENT_ID is indeed a non-encrypted variable in my case. I also tried modifying, but it was only updated for production, while it still hasn't been added to the preview environment. This behavior is quite strange.

Additionally, I don’t understand why NuxtHub doesn’t send secrets to both GitHub and Cloudflare when defining them in NuxtHub. If it's truly impossible to automatically send secrets to GitHub, it would be helpful to have a warning when using GitHub Actions. This way, users would be reminded to update secrets manually if they modify one in NuxtHub.

@RihanArfan
Copy link
Collaborator

RihanArfan commented Mar 22, 2025

After linking the project to a GitHub repository, NuxtHub should sync any created environment variables or secrets to the respective GitHub environment. I'm looking into this.

@RihanArfan RihanArfan self-assigned this Mar 22, 2025
@remihuigen
Copy link

Semi related: When removing a secret from NuxtHub Admin, it's not removed in GitHub secrets..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@maximepvrt @RihanArfan @remihuigen and others