Skip to content

Commit 73a81f3

Browse files
committed
Fix DCO check
Since the checkout action automatically creates a merge commit for merging "master" into a pull request branch, we need to have 21 commits (including the merge commit) to have 20 actual commits. Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 533c87a commit 73a81f3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/build.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,17 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v2
2727
with:
28-
# Assuming that there are at most 20 commits in a single pull
29-
# request, we want to check all commits in a pull request have DCO.
30-
fetch-depth: 20
28+
# By default, the checkout action only fetches the last commit,
29+
# but we want to run DCO check against all commit messages.
30+
# Assuming that a pull request may have multiple commits,
31+
# fetching the single commit doesn't work for us.
32+
#
33+
# While DCO check (on Makefile) checks latest 20 commits,
34+
# the checkout action automatically creates a merge commit
35+
# for merging "master" into a pull request branch.
36+
# So we need to fetch 21 commits (including the merge commit)
37+
# to have 20 actual commits from a pull request.
38+
fetch-depth: 21
3139
- uses: actions/setup-go@v1
3240
with:
3341
go-version: ${{ matrix.go }}

0 commit comments

Comments
 (0)