Skip to content

Commit 1ae955c

Browse files
committed
BUG/MINOR: ci: use two-dot range for checking differences
Change the git log range operator from `...` (three-dot) to `..` (two-dot) in CI job. This ensures that the script only validates new commits from the current branch by properly excluding commits that are already in the target branch.
1 parent 66a0b38 commit 1ae955c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.gitlab/diff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ check-large-files:
6565
# List all files in the latest commit that are larger than 1MB
6666
- |
6767
git fetch origin ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}
68-
git diff --name-only origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}...HEAD | while read file; do
68+
git diff --name-only origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}..HEAD | while read file; do
6969
if [ -f "$file" ] && [ $(stat -c%s "$file") -gt 1048576 ]; then
7070
echo "$file"
7171
fi

.gitlab/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ check-committer:
112112
- |
113113
git fetch origin ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}
114114
BAD_EMAILS=""
115-
for COMMIT in $(git log --format='%H' origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}...HEAD); do
115+
for COMMIT in $(git log --format='%H' origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}..HEAD); do
116116
EMAIL=$(git log -1 --format='%ae' "$COMMIT")
117117
MSG=$(git log -1 --format='%s' "$COMMIT")
118118
case "$EMAIL" in
@@ -125,7 +125,7 @@ check-committer:
125125
esac
126126
done
127127
CO_AUTHORED=""
128-
for COMMIT in $(git log --format='%H' origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}...HEAD); do
128+
for COMMIT in $(git log --format='%H' origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}..HEAD); do
129129
BODY=$(git log -1 --format='%b' "$COMMIT")
130130
MSG=$(git log -1 --format='%s' "$COMMIT")
131131
MATCHED=$(echo "$BODY" | grep -i 'Co-authored-by' || true)

0 commit comments

Comments
 (0)