# Auto-merge in GitHub

**URL:** https://discourse.julialang.org/t/auto-merge-in-github/64504
**Category:** Offtopic
**Created:** [July 12, 2021, 1:16pm UTC](https://discourse.julialang.org/t/auto-merge-in-github/64504 "2021-07-12T13:16:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)
#### Post date: [July 12, 2021, 1:16pm UTC](https://discourse.julialang.org/t/auto-merge-in-github/64504/1 "2021-07-12T13:16:07Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/6/c/6c4e265e3bc1672480c501bd34e12ea5fee2bd15.png)

GitHub supports auto-merging of pull requests (PRs) when GitHub Actions succeed. This is a bit of an overlooked feature (I see almost no one using it) and it’s also poorly documented. So, here is a little tutorial. For the repository that you want to enable auto-merge:

# Go to “Settings” and enable “Allow auto-merge”:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/d/6d85d24e6433d875ebc4b9561f34ddd72bf14bc0.png)

# Go to “Settings → Branches” and enable branch protection for your `main` branch:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/f/cf5dc04821aa82ce782daa3570e31ec80f23a852.png)

# In the branch protection rule for `main`, set at least one required status check:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/7/f/7f8b60b7dcc578a9de6e9d1ba663952a6b12657c.png)

Here, “build-and-deploy” is the name of the job that you defined in your `.yml` file in `.github/workflows/`.

# Use auto-merge

Now, when you create a PR on a repository for which you have sufficient rights, you can click on “auto-merge”:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/7/97efc64638f0e451b38d0fd092d730711dee572b.png)

**Note: It is very important to specify a job! Otherwise, the “auto-merge” button will simply not appear.**

---

<div class="post-metadata">

### Author: ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)
#### Post date: [July 13, 2021, 7:21am UTC](https://discourse.julialang.org/t/auto-merge-in-github/64504/2 "2021-07-13T07:21:54Z")

</div>

Edit: nvm I get it.
