up
This commit is contained in:
parent
27b5977806
commit
85fae47d71
@ -17,24 +17,6 @@ repo_path=$(pwd)
|
||||
# 获取当前分支名
|
||||
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
|
||||
# 检查是否至少有一个分支匹配 .env 中配置的 TEST_BRANCH 或 DRYRUN_BRANCH
|
||||
if [ -f "$repo_path/.env" ]; then
|
||||
export $(grep -v '^#' "$repo_path/.env" | xargs)
|
||||
else
|
||||
echo "⚠️ 缺少 .env 文件,请创建并配置 TEST_BRANCH 和 DRYRUN_BRANCH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$current_branch" != "$TEST_BRANCH" && "$current_branch" != "$DRYRUN_BRANCH" ]]; then
|
||||
echo "⚠️ 当前分支 '$current_branch' 不符合环境变量配置要求。"
|
||||
echo "请确保当前分支与 .env 文件中的 TEST_BRANCH 或 DRYRUN_BRANCH 配置一致。"
|
||||
echo "TEST_BRANCH=$TEST_BRANCH"
|
||||
echo "DRYRUN_BRANCH=$DRYRUN_BRANCH"
|
||||
exit 1
|
||||
else
|
||||
echo "✅ 当前分支 '$current_branch' 符合环境变量配置要求。"
|
||||
fi
|
||||
|
||||
# 开始合并流程
|
||||
echo "🔄 正在切换到目标分支: $dest_branch 并拉取最新代码..."
|
||||
git checkout "$dest_branch"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user