ci: use the target branch for comapring typos

This commit is contained in:
Shubham Patil
2026-03-23 16:12:31 +05:30
parent 3b7f1d4ca6
commit 60adb53d75
+3 -2
View File
@@ -745,9 +745,10 @@ check_typos:
stage: check_typos stage: check_typos
script: script:
- pip install codespell - pip install codespell
- git fetch origin main # Use target branch for MR pipelines, fallback to main for branch push pipelines
- git fetch origin ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-main}
- | - |
FILES=$(git diff --name-only origin/main...HEAD) FILES=$(git diff --name-only origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-main}...HEAD)
echo "change files: $FILES" echo "change files: $FILES"
if [ -n "$FILES" ]; then if [ -n "$FILES" ]; then
./tools/check_typos.sh $FILES ./tools/check_typos.sh $FILES