Skip to content

Commit 83836fc

Browse files
committed
Updating ci/prow/check-commit-count to use the gh cli.
Prow is cloning the repo using `git clone --mirror ...`. In addition to that, the changes are directly tested in the `main` branch, therefore, the current implementation isn't working. Transitioning to the `gh` cli instead. Signed-off-by: Yoni Bettan <[email protected]>
1 parent 071840d commit 83836fc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ci/prow/check-commits-count

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
set -euxo pipefail
44

5-
number_of_commits=$(git rev-list --count HEAD ^main)
6-
if [[ ${number_of_commits} != 1 ]]; then
5+
commits_count=$(gh pr view ${PULL_NUMBER} -R ${REPO_OWNER}/${REPO_NAME} --json commits --jq '.commits | length')
6+
7+
if [[ ${commits_count} != 1 ]]; then
78
echo '
89
All PRs must contain a single commit.
910
Please refer to https://github.com/kubernetes-sigs/kernel-module-management/blob/main/CONTRIBUTING.md

0 commit comments

Comments
 (0)