Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit d8ed339

Browse files
mjuragaaiharos
authored andcommitted
DOC/MINOR: readme: update check-commit readme
1 parent 8381cca commit d8ed339

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

check-commit/README.md

+3-12
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
This action checks that the commit subject is compliant with the [patch classifying rules](https://github.com/haproxy/haproxy/blob/master/CONTRIBUTING#L632) of HAProxy contribution guidelines. Also it does minimal check for a meaningful message in the commit subject: no less than 20 characters and at least 3 words.
66

7-
By default only the top commit subject is checked.
8-
If the commit subject has the format: `Merge 'commitA-ID' into 'commitB-ID'`, all commit subjects between 'commitA' and 'commitB' will be checked.
9-
107
## Examples
118

129
### Good
@@ -48,18 +45,12 @@ None.
4845

4946
```yaml
5047
steps:
51-
- name: Check out code
52-
uses: actions/checkout@v2
53-
with:
54-
fetch-depth: 0
5548
- name: check-commit
5649
uses: docker://haproxytech/check-commit:TAG
50+
env:
51+
API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5752
```
58-
Here we instruct `checkout@v2` action to fetch the repo history.
59-
60-
Check-commit can work on `pull_request` events by inspecting all commit messages between a merge-base commit of the the target branch (usually main, looked up from `$GITHUB_BASE_REF`) and the tip of the feature branch (`$GITHUB_REF`) branch. If the operation is a `push` only the last commit is checked.
61-
62-
For this to work, the `origin/$GITHUB_BASE_REF` ref has to be a part of the history checked out by `actions/checkout@v2`, so `fetch-depth: 0` is can be used as a safe option to fetch the complete repo history. Setting this to a fixed number will limit how many commits are allowed in a Pull Request to that many commits and will speed up the checkout for large repos.
53+
Check-commit works only on `pull_request` events by inspecting all commit messages in a Pull Request. It uses Github API [pull requests API](https://docs.github.com/en/rest/reference/pulls#list-commits-on-a-pull-request) to fetch the commits so API_TOKEN env_variable is required.
6354

6455
## Example configuration
6556

0 commit comments

Comments
 (0)