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
{{ message }}
Repository navigation
Commit c0c258b
Browse filesBrowse the repository at this point in the historyBrowse files
docs(app): document check = "squash" for pull requests (#26)
- **Configuration page**: a new section *Pull requests: every commit, or
the squash message* — why a squash-merge team wants the result checked
rather than the drafts, the two-line config, and a table of what is
checked under each of GitHub's merge settings (PR title vs. "Default
message", single vs. several commits; description / commit messages /
blank body). Notes that the `(#42)` suffix is part of the subject, that
edits re-run, that pushes are not checked commit by commit, and that the
setting is read by the App only.
- **Options table**: the `pull_request.check` row.
- **App guide**: the per-commit bullet now points squash-merge teams at
the setting.
Copy file name to clipboardExpand all lines: docs/configuration.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,40 @@ The value can be a GitHub shorthand, a local path or an HTTPS URL:
96
96
URLs are rejected outright. A repository that silently stops inheriting
97
97
still passes its own checks, so pin the branch when the policy matters.
98
98
99
+
## Pull requests: every commit, or the squash message
100
+
101
+
By default the [GitHub App](guides/integrations.md#as-a-github-app) checks
102
+
every commit of a pull request on its own. A team that squash-merges does not
103
+
keep those commits: what lands on the base branch is one commit whose message
104
+
GitHub builds from the pull request. Checking the drafts instead of the result
105
+
is the reason teams turn commit rules off, so the App can check the result:
106
+
107
+
```toml title="cchk.toml"
108
+
[pull_request]
109
+
check = "squash"
110
+
```
111
+
112
+
With `check = "squash"` a pull request gets **one** Commit Check result on its
113
+
head commit, and it is the message a squash merge would produce, built the way
114
+
GitHub builds it from the repository's merge settings (**Settings → General →
115
+
Pull Requests**):
116
+
117
+
| Repository setting | Title checked | Body checked |
118
+
|---|---|---|
119
+
| Default to pull request title | The pull request title | The pull request description, the commit messages, or nothing, per the setting |
120
+
| Default message, one commit | That commit's title | That commit's body |
121
+
| Default message, several commits | The pull request title | The commit messages, one per bullet |
122
+
123
+
The pull request number GitHub appends to the title (`… (#42)`) is part of what
124
+
is checked, so a subject-length rule sees the real subject. Editing the title
125
+
or description re-runs the check; pushes to the branch are not checked
126
+
commit by commit. Author checks run on the head commit, the branch check on
127
+
the head branch.
128
+
129
+
`check = "commits"` is the default and the behaviour of the CLI, the
130
+
pre-commit hook and the Action, which have no pull request to read. The
131
+
setting is read by the App only.
132
+
99
133
## A worked example
100
134
101
135
Every line below that differs from the built-in default is marked, so it is
@@ -282,3 +316,4 @@ the same thing twice, so read the description rather than the cell:
282
316
| files | max_size | str | "" (disabled) | Largest a committed file may be, in bytes or with a `KB`/`MB`/`GB` suffix (binary units, so `5MB` is 5 × 1024²). Empty disables the rule. |
283
317
| files | prohibited_patterns | list[str] | [] (empty list) | fnmatch patterns a committed path may not match, e.g. `["*.pem", ".env", "id_rsa*"]`. A bare pattern also matches the file name at any depth. Matching is case-sensitive on every platform, like git pathspecs. Empty disables the rule. |
284
318
| files | max_path_length | int | 0 (disabled) | Longest a committed file path may be, in characters. `0` disables the rule. |
319
+
| pull_request | check | str | "commits" | GitHub App only. `"commits"` checks every commit of a pull request on its own; `"squash"` checks the one message a squash merge would land, built from the repository's merge settings. See [Pull requests](#pull-requests-every-commit-or-the-squash-message). |
0 commit comments