You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: check-commit/README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,11 +49,15 @@ steps:
49
49
- name: Check out code
50
50
uses: actions/checkout@v2
51
51
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
53
57
- name: check-commit
54
58
uses: docker://haproxytech/check-commit:TAG
55
59
```
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.
57
61
58
62
## Example configuration
59
63
@@ -96,4 +100,4 @@ TagOrder:
96
100
97
101
### Optional parameters
98
102
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