Skip to content

Commit a977cb9

Browse files
committed
docs: move advanced config to dedicated section with ToC entry
1 parent e71979f commit a977cb9

1 file changed

Lines changed: 36 additions & 25 deletions

File tree

‎README.md‎

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ A GitHub Action for checking commit message formatting, branch naming, committer
2626
* [Optional Inputs](#optional-inputs)
2727
* [GitHub Action Job Summary](#github-action-job-summary)
2828
* [GitHub Pull Request Comments](#github-pull-request-comments)
29+
* [Advanced Configuration](#advanced-configuration)
2930
* [Fork PR Comments](docs/fork-pr-comments.md)
3031
* [Badging Your Repository](#badging-your-repository)
3132
* [Versioning](#versioning)
@@ -164,31 +165,41 @@ jobs:
164165
> ```
165166
> Without `edited`, only the initial title (at PR creation) is validated.
166167

167-
> [!TIP]
168-
> All the inputs above are just the most common options. For advanced configuration
169-
> (e.g., `subject-capitalized`, `require-signed-off-by`, `ai-attribution`, custom
170-
> `allow-commit-types`, etc.), you have **two options**:
171-
>
172-
> **Option 1 — Environment variables** (no config file needed):
173-
>
174-
> Set any `CCHK_*` environment variable in your workflow step. For example:
175-
>
176-
> ```yaml
177-
> - uses: commit-check/commit-check-action@v2
178-
> env:
179-
> CCHK_SUBJECT_CAPITALIZED: "true"
180-
> CCHK_REQUIRE_SIGNED_OFF_BY: "true"
181-
> CCHK_AI_ATTRIBUTION: "forbid"
182-
> CCHK_ALLOW_COMMIT_TYPES: "feat,fix,docs,chore"
183-
> ```
184-
>
185-
> **Option 2 — Configuration file:**
186-
>
187-
> Add a [`commit-check.toml`](https://commit-check.github.io/commit-check/configuration.html)
188-
> or `cchk.toml` to the root of your repository.
189-
>
190-
> The two approaches follow the same priority rule as commit-check itself:
191-
> **CLI args > env vars > config file > defaults**.
168+
## Advanced Configuration
169+
170+
The [Optional Inputs](#optional-inputs) above cover the most common settings.
171+
For everything else (e.g., `subject-capitalized`, `require-signed-off-by`,
172+
`ai-attribution`, custom `allow-commit-types`, etc.), you have two approaches:
173+
174+
### Via Environment Variables
175+
176+
Set any `CCHK_*` environment variable in your workflow step — no config file required:
177+
178+
```yaml
179+
- uses: commit-check/commit-check-action@v2
180+
env:
181+
CCHK_SUBJECT_CAPITALIZED: "true"
182+
CCHK_REQUIRE_SIGNED_OFF_BY: "true"
183+
CCHK_AI_ATTRIBUTION: "forbid"
184+
CCHK_ALLOW_COMMIT_TYPES: "feat,fix,docs,chore"
185+
```
186+
187+
All available environment variables follow the naming convention:
188+
`CCHK_` + uppercase option name with underscores instead of hyphens. See the
189+
[full mapping](https://commit-check.github.io/commit-check/configuration.html#environment-variables)
190+
in the commit-check documentation.
191+
192+
### Via Configuration File
193+
194+
Add a `commit-check.toml` or `cchk.toml` to the root of your repository.
195+
Refer to the [configuration guide](https://commit-check.github.io/commit-check/configuration.html)
196+
for all available options.
197+
198+
> [!NOTE]
199+
> Configuration priority: **CLI args > environment variables > config file > defaults**.
200+
> The action itself doesn't set any CLI flags beyond those in
201+
> [Optional Inputs](#optional-inputs), so env vars and config files are the
202+
> recommended way to customize.
192203

193204
## GitHub Action Job Summary
194205

0 commit comments

Comments
 (0)