# Best way to trigger deploy previews from Github PR comment?

**URL:** <https://answers.netlify.com/t/best-way-to-trigger-deploy-previews-from-github-pr-comment/4135>\
**Category:** Support\
**Tags:** git, deployment\
**Created:** [October 11, 2019, 5:05pm UTC](https://answers.netlify.com/t/best-way-to-trigger-deploy-previews-from-github-pr-comment/4135 "2019-10-11T17:05:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjt](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jjt/32/3419_2.png) [@jjt](https://answers.netlify.com/u/jjt)\
**Post date:** [October 11, 2019, 5:05pm UTC](https://answers.netlify.com/t/best-way-to-trigger-deploy-previews-from-github-pr-comment/4135/1 "2019-10-11T17:05:19Z")

</div>

We like having deploy previews on PRs, but we’re wondering if there’s an easy way to opt into them on a PR-by-PR basis via Github comments instead of having them built automatically for each one.

---

<div class="post-metadata">

**Author:** ![fool](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/fool/32/37_2.png) [@fool](https://answers.netlify.com/u/fool)\
**Post date:** [October 14, 2019, 6:00pm UTC](https://answers.netlify.com/t/best-way-to-trigger-deploy-previews-from-github-pr-comment/4135/2 "2019-10-14T18:00:24Z")

</div>

Not in the way I think you’d want. You can opt out of them in two ways:

1. don’t have us build the branch they are against. This is all-or-nothing and would be annoying to change frequently, but in case you never want to build PRs targeting staging, that’s how you can configure it.

2. use `[skip ci]` somewhere in the commit message to have us not build.

3. we also have the idea of running a script to say whether to build or not:

> **[File-based configuration](https://docs.netlify.com/configure-builds/file-based-configuration/)**
>
> Use a netlify.toml configuration file to specify how the platform builds and deploys your project.

This does require that you have a `base` directory set (so your code is in a subdirectory of the root), but is the most flexible option.
