Module: kamailio
Branch: master
Commit: 3e1b0c026b37be2d7240dae32177c20bf692860f
URL: 
https://github.com/kamailio/kamailio/commit/3e1b0c026b37be2d7240dae32177c20bf692860f

Author: Victor Seva <linuxman...@torreviejawireless.org>
Committer: Victor Seva <linuxman...@torreviejawireless.org>
Date: 2025-04-03T13:37:30+02:00

github: fix scripts/check-* [skip ci]

* fetch ref previous commit too
* add FETCH_DEPTH value so is more visible

---

Modified: .github/scripts/check-cmake-format.sh
Modified: .github/scripts/check-commit.sh
Modified: .github/workflows/pull_request.yml

---

Diff:  
https://github.com/kamailio/kamailio/commit/3e1b0c026b37be2d7240dae32177c20bf692860f.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3e1b0c026b37be2d7240dae32177c20bf692860f.patch

---

diff --git a/.github/scripts/check-cmake-format.sh 
b/.github/scripts/check-cmake-format.sh
index 6c51c415831..582e0324714 100755
--- a/.github/scripts/check-cmake-format.sh
+++ b/.github/scripts/check-cmake-format.sh
@@ -39,6 +39,8 @@ else
 fi
 
 ref=${ref:-HEAD}
+# Ensure that the ref revision has some history
+git fetch -q "--depth=${FETCH_DEPTH:-50}" origin "+${ref}"
 src_sha=$(git rev-parse -q --verify "${ref}") || die "fatal: couldn't find ref 
${ref}"
 echo "Checking $(git rev-list --count "${src_sha}" "^${target_sha}") commits 
since revision ${target_sha}"
 for commit in $(git rev-list --reverse "${src_sha}" "^${target_sha}"); do
diff --git a/.github/scripts/check-commit.sh b/.github/scripts/check-commit.sh
index 144d6a4395e..87aa17be598 100755
--- a/.github/scripts/check-commit.sh
+++ b/.github/scripts/check-commit.sh
@@ -72,6 +72,8 @@ else
 fi
 
 ref=${ref:-HEAD}
+# Ensure that the ref revision has some history
+git fetch -q "--depth=${FETCH_DEPTH:-50}" origin "+${ref}"
 src_sha=$(git rev-parse -q --verify "${ref}") || die "fatal: couldn't find ref 
${ref}"
 echo "Checking $(git rev-list --count "${src_sha}" "^${target_sha}") commits 
since revision ${target_sha}"
 for commit in $(git rev-list --reverse "${src_sha}" "^${target_sha}"); do
diff --git a/.github/workflows/pull_request.yml 
b/.github/workflows/pull_request.yml
index 96f3ac6b864..cdfd9f3a3fd 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -34,6 +34,7 @@ jobs:
         run: ./.github/scripts/check-cmake-format.sh
         env:
           ref: ${{ github.event.pull_request.head.sha }}
+          FETCH_DEPTH: 50
   check-commit:
     runs-on: ubuntu-latest
     permissions:
@@ -47,6 +48,7 @@ jobs:
         run: ./.github/scripts/check-commit.sh
         env:
           ref: ${{ github.event.pull_request.head.sha }}
+          FETCH_DEPTH: 50
   build:
     runs-on: ubuntu-latest
     permissions:

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to