mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-14 11:30:41 +00:00
Allows skipping the full test suite during prepare phase. Testing is deferred to the dedicated Test phase in the pipeline.
52 lines
1.1 KiB
Bash
Executable File
52 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [ "$#" -lt 2 ]; then
|
|
echo "Usage: scripts/pr-prepare <init|validate-commit|gates|push|run> <PR> [--no-test]"
|
|
exit 2
|
|
fi
|
|
|
|
mode="$1"
|
|
pr="$2"
|
|
shift 2
|
|
no_test=false
|
|
for arg in "$@"; do
|
|
case "$arg" in
|
|
--no-test) no_test=true ;;
|
|
esac
|
|
done
|
|
script_dir="$(cd "$(dirname "$0")" && pwd)"
|
|
base="$script_dir/pr"
|
|
if common_git_dir=$(git -C "$script_dir" rev-parse --path-format=absolute --git-common-dir 2>/dev/null); then
|
|
canonical_base="$(dirname "$common_git_dir")/scripts/pr"
|
|
if [ -x "$canonical_base" ]; then
|
|
base="$canonical_base"
|
|
fi
|
|
fi
|
|
|
|
case "$mode" in
|
|
init)
|
|
exec "$base" prepare-init "$pr"
|
|
;;
|
|
validate-commit)
|
|
exec "$base" prepare-validate-commit "$pr"
|
|
;;
|
|
gates)
|
|
if [ "$no_test" = "true" ]; then
|
|
exec "$base" prepare-gates "$pr" true
|
|
else
|
|
exec "$base" prepare-gates "$pr"
|
|
fi
|
|
;;
|
|
push)
|
|
exec "$base" prepare-push "$pr"
|
|
;;
|
|
run)
|
|
exec "$base" prepare-run "$pr"
|
|
;;
|
|
*)
|
|
echo "Usage: scripts/pr-prepare <init|validate-commit|gates|push|run> <PR>"
|
|
exit 2
|
|
;;
|
|
esac
|