Skip to content

Commit e1f220a

Browse files
committed
Fixing ci/prow/check-commit-count.
The implementation of that job is relying on the diff with the `main` branch. In order to make sure the `main` branch is up to date, we need to fetch it first. Signed-off-by: Yoni Bettan <[email protected]>
1 parent e7b9300 commit e1f220a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ci/prow/check-commits-count

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
set -euxo pipefail
44

5-
number_of_commits=$(git rev-list --count HEAD ^main)
6-
if [[ ${number_of_commits} != 1 ]]; then
5+
git remote add upstream https://github.com/kubernetes-sigs/kernel-module-management.git
6+
git fetch upstream
7+
8+
number_of_commits=$(git rev-list --count HEAD ^upstream/main)
9+
# Look like Git (in Prow only) is adding an additional commit for each PR,
10+
# therefore, we are making sure there are 2 commits instead of 1
11+
if [[ ${number_of_commits} != 2 ]]; then
712
echo '
813
All PRs must contain a single commit.
914
Please refer to https://github.com/kubernetes-sigs/kernel-module-management/blob/main/CONTRIBUTING.md

0 commit comments

Comments
 (0)