Vercel’s documentation mentions that only one custom environment variable can be overridden in the Pro plan. However, I need to override system environment variables specifically within my GitHub Actions workflow.
In my deployment setup, Vercel detects the branch and triggers an automatic release.
I know that using custom environment variables allows multiple values to be changed. However, I noticed that the API modifies original_environment and environment values.
Would it be possible to override these values to receive my desired environment configuration? If so, how can I achieve this?
Great question. You’ve touched on some important aspects of Vercel’s environment handling. Let me clarify a few points and suggest a workable solution:
The Pro plan limitation you mentioned applies to custom environment variables, not system ones like original_environment and environment. These system variables are internal to Vercel and can’t be directly overridden, regardless of the plan.
You’re correct that the API modifies original_environment and environment. This is by design and part of Vercel’s deployment process.
Instead of trying to override these system values, you should:
a) Use Vercel’s built-in environment detection
b) Structure your application to handle environment-specific logic based on other available environment variables
Here’s an example of how you can achieve this in your GitHub Actions workflow:
Thank you for your response! However, it was slightly off-topic.
Here’s the exact issue I want to solve:
I’ve developed a GitHub Action that triggers when a deployment to dev or another feat branch is successfully completed.
However, due to Vercel’s nature,
when merging feat → dev and the deployment completes, two Preview deployments are created.
As a result, a single commit triggers two deployment notifications.
To address this, I considered using commit ref or SHA to determine a unique value,
but I couldn’t find a way to make it work (or maybe I’m missing something).
Additionally, this GitHub Action is not limited to Vercel notifications but is meant for general deployment notifications.
For reference, I am not considering using the Vercel CLI.
P.S.
I have confirmed that custom env works correctly and have tested it successfully.
However, even with the PRO plan, only one custom env can be used, which significantly limits its usefulness.
The difference in capacity between the PRO and Enterprise plans is too large.