fix(deploy): force push main branch
This commit is contained in:
@@ -13,8 +13,13 @@ push_to_remote() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local push_args=()
|
||||||
|
if [ "$branch" = "main" ]; then
|
||||||
|
push_args+=("--force")
|
||||||
|
fi
|
||||||
|
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo "git push $remote $branch ..."
|
echo "git push ${push_args[*]} $remote $branch ..."
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
|
|
||||||
local current=$(git branch --show-current 2>/dev/null || echo "unknown")
|
local current=$(git branch --show-current 2>/dev/null || echo "unknown")
|
||||||
@@ -29,7 +34,7 @@ push_to_remote() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git push "$remote" "$branch"
|
git push "${push_args[@]}" "$remote" "$branch"
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
|
|||||||
Reference in New Issue
Block a user