diff --git a/hooks/pre-checkout b/hooks/pre-checkout new file mode 100755 index 0000000..01db2b6 --- /dev/null +++ b/hooks/pre-checkout @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "Running git-shallow-clone-buildkite-plugin -- pre-checkout" + +DEPTH="${BUILDKITE_PLUGIN_GIT_SHALLOW_CLONE_DEPTH:-1}" +export BUILDKITE_GIT_CLONE_FLAGS="-v --depth ${DEPTH}" +#export BUILDKITE_GIT_FETCH_FLAGS="-v --prune --depth ${DEPTH}" + +#export BUILDKITE_GIT_CLONE_FLAGS="-v --filter=blob:none" diff --git a/plugin.yml b/plugin.yml new file mode 100644 index 0000000..6bd88da --- /dev/null +++ b/plugin.yml @@ -0,0 +1,9 @@ +name: Git shallow clone +description: Sets git-clone and git-fetch flags to perform a shallow clone +author: https://github.com/vgrigoruk +requirements: ['git'] +configuration: + properties: + depth: + type: number + additionalProperties: false