Skip to content

Commit 683b293

Browse files
committed
DOC: update README.md with new github actions recommended configuration
1 parent a3e2876 commit 683b293

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

check-commit/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,15 @@ steps:
4949
- name: Check out code
5050
uses: actions/checkout@v2
5151
with:
52-
fetch-depth: 10
52+
fetch-depth: 0
53+
- name: Create base branch reference
54+
uses: actions/checkout@v2
55+
with:
56+
ref: main
5357
- name: check-commit
5458
uses: docker://haproxytech/check-commit:TAG
5559
```
56-
Here we instruct `checkout@v2` action to fetch last 10 commits (by default it fetches only last one) which is required in case of checking multiple commits.
60+
Here we instruct `checkout@v2` action to fetch the repo history, as well as the main branch of the repo. This creates git refs in the checked-out repository so that the check-commit can do a merge-base operation against the main and the feature branch. Modify the main repo name from this example to reflect what is the main repo name in your own repository.
5761

5862
## Example configuration
5963

@@ -96,4 +100,4 @@ TagOrder:
96100

97101
### Optional parameters
98102

99-
The program accepts an optional parameter to specify the location (path) of the base of the git repository.
103+
The program accepts an optional parameter to specify the location (path) of the base of the git repository. This can be useful in certain cases where the checked-out repo is in a non-standard location within the CI environment, compared to the running path from which the check-commit binary is being invoked.

0 commit comments

Comments
 (0)