[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live) [Help](/c/help/9) # Dynamically create env variables in mono repos using vercel github bot 118 views · 1 like · 4 posts Fohoov (@fohoov) · 2024-08-02 There are lots of cases when in mono-repo you create a pull request that changes two or more projects. Lets consider a simple example, a monorepo with backend and frontend. Both of these projects create a deployment to vercel (preview) on each pull request. So lets say you are creating a pull request from branch feature-1 to main: 1- front: deployed to vercel preview on url: something-feat-1-preview.vercel.app 2- back: deplyoyed to vercel preview on url: something-feat1-be-preview.vercel.app The front-end uses the backend URL to make requests to, but on each deplyoment these URLS change and we need a way to set it to the correct thing (also there are cases where the build process uses the API_URL, so the project might get built with the incorrect url, frontend's deployment should happen AFTER the backend project is deployed). I really don't know how to achieve this. I would appreacite any help!! thanks for your time >_< Amy Egan (@amyegan) · 2024-08-02 · ♥ 1 Hi @fohoov! You could use the `vercel alias` command in the CLI to assign consistent domains to each new preview deployment of the frontend and backend projects. A [custom workflow](https://examples.vercel.com/guides/using-vercel-cli-for-custom-workflows) could work well for this if you want to automate. As another option, you could take advantage of the [predictable URL with Git branch](https://vercel.com/docs/deployments/generated-urls#url-with-git-branch) and [branch-specific preview environment variables](https://vercel.com/changelog/environments-variables-per-git-branch). There's also a new option to [automatically skip unnecessary deployments in monorepos](https://vercel.com/changelog/automatically-skip-unnecessary-deployments-in-monorepos) which could help you avoid unnecessary deployments. Fohoov (@fohoov) · 2024-08-04 Thanks for your reply! It really helped me a lot! I used the cli to build and deploy. The only downside is that I have to do two things: 1. disable automatic build/deploys on any branch other than main 2. the lovely vercel bot doesn't show the deployed URLs after I deploy using vercel deploy anymore (cuz of step-1) Is there a way to notify the vercel-bot that: "hey, I did this manually can you please update your comments and URLs?" Amy Egan (@amyegan) · 2024-08-05 I don't have a way to tell the vercel-bot to add a comment if it didn't create the deployment, but you could add a PR comment as part of a custom workflow. https://github.com/actions/github-script#comment-on-an-issue