Skip to content

Commit

Permalink
ci: use different base commit for merge result pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
hfudev committed Oct 31, 2024
1 parent e2e4a36 commit a4ef854
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .gitlab/ci/pre_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,24 @@ baseline_manifest_sha:
tags: [fast_run, shiny]
script:
- |
if [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
# merged results pipelines, by default
# diff between target-branch-head and merged-result-head
if [ -n "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA" ]; then
git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_SHA --depth=1
git checkout FETCH_HEAD
idf-build-apps dump-manifest-sha \
--manifest-files $(find . -name ".build-test-rules.yml" | xargs) \
--output .manifest_sha
# merge request pipelines, when the mr got conflicts
# diff between diff-base-sha and merge-request-head
elif [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
git fetch origin $CI_MERGE_REQUEST_DIFF_BASE_SHA --depth=1
git checkout FETCH_HEAD
idf-build-apps dump-manifest-sha \
--manifest-files $(find . -name ".build-test-rules.yml" | xargs) \
--output .manifest_sha
# other pipelines, like the protected branches pipelines
# not triggered in this job
fi
artifacts:
paths:
Expand Down

0 comments on commit a4ef854

Please sign in to comment.