debian-mirror-gitlab/scripts/checkout-mr-source-sha
2022-08-13 15:12:31 +05:30

7 lines
483 B
Bash
Executable file

#!/bin/sh
if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA" ]; then
echo "Checking out \$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA ($CI_MERGE_REQUEST_SOURCE_BRANCH_SHA) instead of \$CI_COMMIT_SHA (merge result commit $CI_COMMIT_SHA) so that code is in sync with gitlab images built upstream."
echo "See https://docs.gitlab.com/ee/development/testing_guide/end_to_end/index.html#with-pipeline-for-merged-results for more details."
git checkout -f ${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}
fi