Skip to content

Commit 7779aa9

Browse files
committed
docs: open the README with one-check workflows for PR titles and branch names
Most of the field does one thing: the most-used PR title check only reads the title, and branch name checks only read the branch. Show that the Action does each in a complete workflow before the full setup, so a reader who wants one check finds it without reading the inputs table first.
1 parent c4caa6e commit 7779aa9

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,54 @@ request — message, branch, author, and optionally the PR title — against you
2727
`cchk.toml`, and reports the result in the job summary, as annotations on the
2828
diff and, if you want, as a PR comment.
2929

30+
## Start with one check
31+
32+
Each of these is a complete workflow. Pick one, then turn on more checks when
33+
you need them.
34+
35+
**Pull request title only.** On a repository that squash-merges, the title
36+
becomes the commit on `main`, so it is the one message worth checking:
37+
38+
```yaml
39+
name: PR Title
40+
41+
on:
42+
pull_request:
43+
types: [opened, edited, synchronize, reopened]
44+
45+
jobs:
46+
pr-title:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v7
50+
- uses: commit-check/commit-check-action@v2
51+
with:
52+
message: false
53+
branch: false
54+
pr-title: true
55+
```
56+
57+
**Branch name only**, against [Conventional Branch](https://conventionalbranch.org/):
58+
59+
```yaml
60+
name: Branch Name
61+
62+
on:
63+
pull_request:
64+
65+
jobs:
66+
branch-name:
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v7
70+
- uses: commit-check/commit-check-action@v2
71+
with:
72+
message: false
73+
```
74+
75+
Both read the repository's `cchk.toml` if there is one, so a custom type list
76+
or an extra allowed branch name works without changing the workflow.
77+
3078
## Usage
3179

3280
Add a workflow, e.g. `.github/workflows/commit-check.yml`:

0 commit comments

Comments
 (0)