Skip to content

Commit

Permalink
Fixing check-commits-count to work on other branches than main. (#…
Browse files Browse the repository at this point in the history
…270)

Signed-off-by: Yoni Bettan <yonibettan@gmail.com>
  • Loading branch information
ybettan authored Jan 29, 2023
1 parent f9a57a8 commit 5d7ef28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ci/prow/check-commits-count
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set -euxo pipefail
git remote add upstream https://github.com/kubernetes-sigs/kernel-module-management.git
git fetch upstream

commits_count=$(git rev-list --count HEAD ^upstream/main)
branch_name=$(git branch --show-current)
commits_count=$(git rev-list --count HEAD ^upstream/${branch_name})
# When Prow is testing a PR, it is creating a branch for it but then merges it
# into the "main" branch for testing, therefore, we also get the "merge commit"
# in addition to the original commit.
Expand Down

0 comments on commit 5d7ef28

Please sign in to comment.