You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If the PR creator is the expected account, stop now
25
+
if (prCreator === 'Octomerger') {
26
+
return
27
+
}
28
+
29
+
try {
30
+
await github.teams.getMembershipForUserInOrg({
31
+
org: 'github',
32
+
team_slug: 'employees',
33
+
username: prCreator
34
+
})
35
+
36
+
// If the PR creator is a GitHub employee, stop now
37
+
return
38
+
} catch (err) {
39
+
// An error will be thrown if the user is not a GitHub employee.
40
+
// That said, we still want to proceed anyway!
41
+
}
42
+
43
+
const pr = context.payload.pull_request
44
+
const { owner, repo } = context.repo
45
+
46
+
// Close the PR and add the invalid label
47
+
await github.issues.update({
48
+
owner: owner,
49
+
repo: repo,
50
+
issue_number: pr.number,
51
+
labels: ['invalid'],
52
+
state: 'closed'
53
+
})
54
+
55
+
// Comment on the PR
56
+
await github.issues.createComment({
57
+
owner: owner,
58
+
repo: repo,
59
+
issue_number: pr.number,
60
+
body: "Please leave this `repo-sync` branch to the robots!\n\nI'm going to close this pull request now, but feel free to open a new issue or ask any questions in [discussions](https://github.com/github/docs/discussions)!"
Copy file name to clipboardExpand all lines: content/github/administering-a-repository/about-protected-branches.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -82,12 +82,12 @@ After enabling required status checks, all required status checks must pass befo
82
82
83
83
{% endnote %}
84
84
85
-
You can set up required status checks to either be "loose" or "strict." The type of required status check you choose determines whether your branch is required to be up-to-date with the base branch before merging.
85
+
You can set up required status checks to either be "loose" or "strict." The type of required status check you choose determines whether your branch is required to be up to date with the base branch before merging.
86
86
87
87
| Type of required status check | Setting | Merge requirements | Considerations |
88
88
| --- | --- | --- | --- |
89
-
|**Strict**| The **Require branches to be up-to-date before merging** checkbox is checked. | The branch **must** be up to date with the base branch before merging. | This is the default behavior for required status checks. More builds may be required, as you'll need to bring the head branch up to date after other collaborators merge pull requests to the protected base branch.|
90
-
|**Loose**| The **Require branches to be up-to-date before merging** checkbox is **not** checked. | The branch **does not** have to be up to date with the base branch before merging. | You'll have fewer required builds, as you won't need to bring the head branch up to date after other collaborators merge pull requests. Status checks may fail after you merge your branch if there are incompatible changes with the base branch. |
89
+
|**Strict**| The **Require branches to be up to date before merging** checkbox is checked. | The branch **must** be up to date with the base branch before merging. | This is the default behavior for required status checks. More builds may be required, as you'll need to bring the head branch up to date after other collaborators merge pull requests to the protected base branch.|
90
+
|**Loose**| The **Require branches to be up to date before merging** checkbox is **not** checked. | The branch **does not** have to be up to date with the base branch before merging. | You'll have fewer required builds, as you won't need to bring the head branch up to date after other collaborators merge pull requests. Status checks may fail after you merge your branch if there are incompatible changes with the base branch. |
91
91
| **Disabled** | The **Require status checks to pass before merging** checkbox is **not** checked. | The branch has no merge restrictions. | If required status checks aren't enabled, collaborators can merge the branch at any time, regardless of whether it is up to date with the base branch. This increases the possibility of incompatible changes.
92
92
93
93
For troubleshooting information, see "[Troubleshooting required status checks](/github/administering-a-repository/troubleshooting-required-status-checks)."
0 commit comments