Skip to content

Commit a2ffd9e

Browse files
committed
Merge branch 'ci/fix_diff_manifest_sha_v5.4' into 'release/v5.4'
ci: use different base commit for merge result pipelines (v5.4) See merge request espressif/esp-idf!34582
2 parents 0e6c74e + 5f62667 commit a2ffd9e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.gitlab/ci/pre_check.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,24 @@ baseline_manifest_sha:
183183
tags: [fast_run, shiny]
184184
script:
185185
- |
186-
if [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
186+
# merged results pipelines, by default
187+
# diff between target-branch-head and merged-result-head
188+
if [ -n "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA" ]; then
189+
git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_SHA --depth=1
190+
git checkout FETCH_HEAD
191+
idf-build-apps dump-manifest-sha \
192+
--manifest-files $(find . -name ".build-test-rules.yml" | xargs) \
193+
--output .manifest_sha
194+
# merge request pipelines, when the mr got conflicts
195+
# diff between diff-base-sha and merge-request-head
196+
elif [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
187197
git fetch origin $CI_MERGE_REQUEST_DIFF_BASE_SHA --depth=1
188198
git checkout FETCH_HEAD
189199
idf-build-apps dump-manifest-sha \
190200
--manifest-files $(find . -name ".build-test-rules.yml" | xargs) \
191201
--output .manifest_sha
202+
# other pipelines, like the protected branches pipelines
203+
# not triggered in this job
192204
fi
193205
artifacts:
194206
paths:

0 commit comments

Comments
 (0)