This commit is contained in:
carlospolop
2025-10-04 01:36:08 +02:00
parent abb82f5a11
commit 005de3a0e1
2 changed files with 5 additions and 5 deletions

View File

@@ -95,8 +95,8 @@ jobs:
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
git commit -m "Update searchindex files - ${TIMESTAMP}" --allow-empty
# Force push to replace main branch (deletes history, keeps all files)
git push -f origin new-main:main
# Force push to replace master branch (deletes history, keeps all files)
git push -f origin new-main:master
echo "Successfully reset repository history and pushed all searchindex files"

View File

@@ -201,7 +201,7 @@ jobs:
MAX_RETRIES=20
RETRY_COUNT=0
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
if git push origin main; then
if git push origin master; then
echo "Successfully pushed on attempt $((RETRY_COUNT + 1))"
break
else
@@ -210,11 +210,11 @@ jobs:
echo "Push failed, attempt $RETRY_COUNT/$MAX_RETRIES. Pulling and retrying..."
# Try normal rebase first
if git pull --rebase origin main 2>&1 | tee /tmp/pull_output.txt; then
if git pull --rebase origin master 2>&1 | tee /tmp/pull_output.txt; then
echo "Rebase successful, retrying push..."
else
# If rebase fails due to divergent histories (orphan branch reset), re-clone
if grep -q "unrelated histories\|refusing to merge\|fatal: invalid upstream" /tmp/pull_output.txt; then
if grep -q "unrelated histories\|refusing to merge\|fatal: invalid upstream\|couldn't find remote ref" /tmp/pull_output.txt; then
echo "Detected history rewrite, re-cloning repository..."
cd /tmp
rm -rf searchindex-repo