Skip to content

Commit

Permalink
Merge branch 'ci/fix_fetch_git_diff_on_schedules' into 'master'
Browse files Browse the repository at this point in the history
ci: fix fetch git diff from pipeline schedules

See merge request espressif/esp-idf!27263
  • Loading branch information
ydesp committed Nov 24, 2023
2 parents 76011fc + 294222e commit ab03c2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .gitlab/ci/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,14 @@ variables:
git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_COMMIT_SHA)
# other pipelines, like the protected branches pipelines
else
elif [[ "$CI_COMMIT_BEFORE_SHA" != "0000000000000000000000000000000000000000" ]]; then
git fetch origin $CI_COMMIT_BEFORE_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_COMMIT_BEFORE_SHA $CI_COMMIT_SHA)
else
# pipeline source could be web, scheduler, etc.
git fetch origin $CI_COMMIT_SHA --depth=2 ${GIT_FETCH_EXTRA_FLAGS}
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_COMMIT_SHA~1 $CI_COMMIT_SHA)
fi
- *git_checkout_fetch_head
- *common-before_scripts
Expand Down

0 comments on commit ab03c2e

Please sign in to comment.