git-docker/rootfs/usr/local/bin/clone-pull-request
Markus Pesch 9fae1f4211
Some checks failed
continuous-integration/drone/push Build is failing
fix: use whitespaces instead of tabs
2023-10-01 20:44:02 +02:00

21 lines
370 B
Bash
Executable File

#!/bin/bash
FLAGS=""
if [[ -n "${PLUGIN_DEPTH}" ]]; then
FLAGS="--depth=${PLUGIN_DEPTH}"
fi
if [ ! -d .git ]; then
git init
git remote add origin "${DRONE_REMOTE_URL}"
fi
set -e
set -x
git fetch ${FLAGS} origin "+refs/heads/${DRONE_COMMIT_BRANCH}:"
git checkout "${DRONE_COMMIT_BRANCH}"
git fetch origin "${DRONE_COMMIT_REF}:"
git merge "${DRONE_COMMIT_SHA}"