Replies: 1 comment 3 replies
-
Have you seen the Ignore Build Step? https://vercel.com/support/articles/how-do-i-use-the-ignored-build-step-field-on-vercel |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
By default vercel builds a preview for every commit on every branch. This might be useful for some but I find it wasteful so I've added a custom script in the build step to only allow a build if the commit is on the production branch and if it there are changes in a relevant package (I'm using a mono repo).
This works well however now I don't get preview links for pull requests automatically (which was useful) , because the pull request commits are counted as not being on the production branch so I need to create these manually since there is no information from the vercel environment variables to determine if a commit is part of a pull request.
I can probably setup a github action to do this but it would be good if the Vercel for Github integration just provided an environment variable saying if the preview is part of a pull request and that could be used as part of the custom build script, to keep the conditional build logic in one place.
An example implementation could be an environment variable that says "true" /"false" or an environment variable that gives the pull request name if it exits otherwise is blank if the commit is not associated with a pull request.
Beta Was this translation helpful? Give feedback.
All reactions