git-docker/rootfs/usr/local/bin/clone-pull-request
Markus Pesch f3c90af2b7
All checks were successful
continuous-integration/drone/push Build is passing
fix: remove ls
2023-10-01 21:16:54 +02:00

20 lines
363 B
Bash
Executable File

#!/bin/bash
set -e
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
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}"