Skip to content

Commit e71979f

Browse files
committed
docs: add env vars usage for advanced configuration options
1 parent aa0dca3 commit e71979f

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,31 @@ jobs:
164164
> ```
165165
> Without `edited`, only the initial title (at PR creation) is validated.
166166

167-
Note: the default rule of above inputs is following [this configuration](https://github.com/commit-check/commit-check-action/blob/main/commit-check.toml). If you want to customize, just add your [`commit-check.toml`](https://commit-check.github.io/commit-check/configuration.html) config file under your repository root directory.
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**.
168192

169193
## GitHub Action Job Summary
170194

0 commit comments

Comments
 (0)