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

Difficulty adding multiple environment variables in vercel-args #38

Closed
jacobdo2 opened this issue Sep 28, 2020 · 3 comments
Closed

Difficulty adding multiple environment variables in vercel-args #38

jacobdo2 opened this issue Sep 28, 2020 · 3 comments
Assignees

Comments

@jacobdo2
Copy link

I have been trying to pass multiple through the vercel args, but not having much luck.

According to the documentation here https://vercel.com/docs/cli#commands/overview/unique-options/build-env, environment variables for build time should be set as follows:

vercel-args: --build-env [NODE_ENV=pr,PR_NUMBER=${{ github.event.number }}]

However this fails with an error:
Error! The specified file or directory "PR_NUMBER=423]" does not exist.

@amondnet amondnet self-assigned this Oct 5, 2020
@amondnet
Copy link
Owner

amondnet commented Oct 5, 2020

@jacobdo2 Hi,
According to the document:

vercel --build-env KEY1=value1 --build-env KEY2=value2

Have you tried the following?

vercel-args: --build-env NODE_ENV=pr --build-env PR_NUMBER=${{ github.event.number }}

Alternatively, we can add a build-env argument like alias-domains. It will be implemented like below. (github actions doesn't support list or map args) Would it be better to add the build-env argument?

  • Option 1
    build-env: |
      NODE_ENV=pr
      PR_NUMBER=${{ github.event.number }}
  • Option 2
    build-env: '[{"NODE_ENV": "pr", "PR_NUMBER": ${{ github.event.number }}]'

@jacobdo2
Copy link
Author

jacobdo2 commented Oct 5, 2020

I don't understand how I came across the other piece of documentation which lists the example I have indicated above, thanks for your help. Props on this repo, really helpful 👍

@jacobdo2 jacobdo2 closed this as completed Oct 5, 2020
@dgokcin
Copy link

dgokcin commented Nov 3, 2022

@amondnet @jacobdo2 is does that mean that option 1 is working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants