Skip to content
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

Environment variables are not copied over to Github #408

Closed
Youhan opened this issue Jan 4, 2025 · 3 comments
Closed

Environment variables are not copied over to Github #408

Youhan opened this issue Jan 4, 2025 · 3 comments
Labels
question Further information is requested

Comments

@Youhan
Copy link

Youhan commented Jan 4, 2025

Describe the bug
Docs says:

NuxtHub automatically copies all your project's environment variables to your GitHub repository actions environment variables. When encrypting an environment variable in the NuxtHub Admin, a GitHub actions secret will be created in your repository.
It looks like the variables and secrets are not being copied from NuxtHub Admin to the github repository.

Steps to reproduce
Steps to reproduce the behavior:

  1. Create a private repo in GitHub under an organization account
  2. create a new project in NuxtHub using the Github repo
  3. add a runtime config variable like NUXT_SIGNATURE_SECRET_KEY
  4. Deploy
    After deploy you can check the useRuntimeConfig().signatureSecretKey, the value is empty.

I checked the Repository settings in Github, under /settings/secrets/actions and there is no env variable or secret. So I guess the project is being built without any environment variables.

Nuxthub Admin
image

Secrets are empty
Screenshot 2025-01-03 at 10 46 18 PM

Variables are empty
Screenshot 2025-01-03 at 10 46 34 PM

Expected behavior
I was expecting to see the secrets and variables copied over from Nuxthub admin to the GitHub repository,

@Youhan
Copy link
Author

Youhan commented Jan 4, 2025

Ah, It looks like Github does not let you create environments on a free organization private repository!

@Youhan
Copy link
Author

Youhan commented Jan 4, 2025

Also, it looks like when used in Nitro and Cloudflare, we need to pass the event to useRuntimeConfig(event).signatureSecretKey

Copy link
Contributor

atinux commented Jan 8, 2025

Yeah we faced an issue to sync the environments variables & secrets on a free GitHub account as we cannot created environments (production / preview).

For these build-time environment variables & secrets you have to create them manually in your GitHub repository.

I will add a note in the documentation regarding this, thank you for reporting.

@atinux atinux added the question Further information is requested label Jan 8, 2025 — with Linear
@atinux atinux closed this as completed in 46fc4e3 Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants