~sircmpwn/sr.ht-docs

92689ec4c546fa18fc5befe1f8acef2741a86eb7 — Drew DeVault 1 year, 10 months ago a8cdba3
Update dispatch.sr.ht/github.md
1 files changed, 28 insertions(+), 28 deletions(-)

M dispatch.sr.ht/github.md
M dispatch.sr.ht/github.md => dispatch.sr.ht/github.md +28 -28
@@ 5,34 5,6 @@ title: GitHub integration
dispatch.sr.ht supports various integrations with [GitHub](https://github.com).
Some tips are provided here.

# Configuring branch protection rules on GitHub

If you choose the "auto-merge" setting, builds.sr.ht will attempt to merge the
pull request once the build completes successfully. You will likely want to add
branch protection rules on GitHub to prevent this from happening before the pull
request is reviewed.

To edit your branch protection rules, start by visiting "Branches" in your
repository's settings.

![Screenshot of the "branches" page](https://sr.ht/465d.png)

Select "Add rule".

![Screenshot of "add rule"](https://sr.ht/rtPV.png)

Specify the branches you want the rule to apply to (e.g. "master") and configure
the criteria which must be met for the pull request to be mergeable. For
example, to require the code to be reviewed before merge:

![Screenshot of code review settings](https://sr.ht/UeBt.png)

**Important**: if your account is an administrator on this GitHub repository,
attempts to merge will succeed *even if the branch protection rules are unmet*.
You must enable the "Include administrators" option to prevent this.

![Screenshot of "Include administrators" option](https://sr.ht/7VYq.png)

# Build environment

dispatch.sr.ht will check out the specific commit you pushed when submitting


@@ 60,3 32,31 @@ The following environment variables are set when building pull requests:
- `GITHUB_PR_TITLE`: the title of the pull request
- `GITHUB_BASE_REPO`: the full name (e.g. "username/repo_name") of the base repo
- `GITHUB_HEAD_REPO`: the full name (e.g. "username/repo_name") of the head repo (fork)

# Configuring branch protection rules on GitHub

If you choose the "auto-merge" setting, builds.sr.ht will attempt to merge the
pull request once the build completes successfully. You will likely want to add
branch protection rules on GitHub to prevent this from happening before the pull
request is reviewed.

To edit your branch protection rules, start by visiting "Branches" in your
repository's settings.

![Screenshot of the "branches" page](https://sr.ht/465d.png)

Select "Add rule".

![Screenshot of "add rule"](https://sr.ht/rtPV.png)

Specify the branches you want the rule to apply to (e.g. "master") and configure
the criteria which must be met for the pull request to be mergeable. For
example, to require the code to be reviewed before merge:

![Screenshot of code review settings](https://sr.ht/UeBt.png)

**Important**: if your account is an administrator on this GitHub repository,
attempts to merge will succeed *even if the branch protection rules are unmet*.
You must enable the "Include administrators" option to prevent this.

![Screenshot of "Include administrators" option](https://sr.ht/7VYq.png)