Skip to content

Commit bf6bddc

Browse files
committed
Improve the commit logic on windows for the libraries
1 parent 1330e92 commit bf6bddc

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/actions/rive-build/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,22 @@ runs:
145145
msg="$msg - ${COMMIT_SUFFIX}"
146146
fi
147147
git commit -m "$msg"
148+
git config http.version HTTP/1.1
148149
max_attempts=3
149150
attempt=1
150151
until [ $attempt -gt $max_attempts ]; do
151152
echo "Attempt $attempt: rebase + push"
152153
if git pull --rebase origin "${GITHUB_REF_NAME}"; then
154+
local_sha="$(git rev-parse HEAD)"
153155
if git push origin HEAD:"${GITHUB_REF_NAME}"; then
154156
echo "Push succeeded"
155157
break
156158
fi
159+
remote_sha="$(git ls-remote origin "refs/heads/${GITHUB_REF_NAME}" | awk '{print $1}' || true)"
160+
if [ -n "${remote_sha}" ] && [ "${remote_sha}" = "${local_sha}" ]; then
161+
echo "Remote branch already points at ${local_sha}; treating push as successful."
162+
break
163+
fi
157164
else
158165
echo "Rebase failed; aborting and retrying"
159166
git rebase --abort || true

.github/workflows/branch-artifacts.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,22 @@ jobs:
454454
msg="$msg - ${{ github.event.inputs.commit_message }}"
455455
fi
456456
git commit -m "$msg"
457+
git config http.version HTTP/1.1
457458
max_attempts=3
458459
attempt=1
459460
until [ $attempt -gt $max_attempts ]; do
460461
echo "Attempt $attempt: rebase + push"
461462
if git pull --rebase origin "${{ github.ref_name }}"; then
463+
local_sha="$(git rev-parse HEAD)"
462464
if git push origin HEAD:"${{ github.ref_name }}"; then
463465
echo "Push succeeded"
464466
break
465467
fi
468+
remote_sha="$(git ls-remote origin "refs/heads/${{ github.ref_name }}" | awk '{print $1}' || true)"
469+
if [ -n "${remote_sha}" ] && [ "${remote_sha}" = "${local_sha}" ]; then
470+
echo "Remote branch already points at ${local_sha}; treating push as successful."
471+
break
472+
fi
466473
else
467474
echo "Rebase failed; aborting and retrying"
468475
git rebase --abort || true
@@ -593,15 +600,22 @@ jobs:
593600
msg="$msg - ${{ github.event.inputs.commit_message }}"
594601
fi
595602
git commit -m "$msg"
603+
git config http.version HTTP/1.1
596604
max_attempts=3
597605
attempt=1
598606
until [ $attempt -gt $max_attempts ]; do
599607
echo "Attempt $attempt: rebase + push"
600608
if git pull --rebase origin "${{ github.ref_name }}"; then
609+
local_sha="$(git rev-parse HEAD)"
601610
if git push origin HEAD:"${{ github.ref_name }}"; then
602611
echo "Push succeeded"
603612
break
604613
fi
614+
remote_sha="$(git ls-remote origin "refs/heads/${{ github.ref_name }}" | awk '{print $1}' || true)"
615+
if [ -n "${remote_sha}" ] && [ "${remote_sha}" = "${local_sha}" ]; then
616+
echo "Remote branch already points at ${local_sha}; treating push as successful."
617+
break
618+
fi
605619
else
606620
echo "Rebase failed; aborting and retrying"
607621
git rebase --abort || true
@@ -710,15 +724,22 @@ jobs:
710724
msg="$msg - ${{ github.event.inputs.commit_message }}"
711725
fi
712726
git commit -m "$msg"
727+
git config http.version HTTP/1.1
713728
max_attempts=3
714729
attempt=1
715730
until [ $attempt -gt $max_attempts ]; do
716731
echo "Attempt $attempt: rebase + push"
717732
if git pull --rebase origin "${{ github.ref_name }}"; then
733+
local_sha="$(git rev-parse HEAD)"
718734
if git push origin HEAD:"${{ github.ref_name }}"; then
719735
echo "Push succeeded"
720736
break
721737
fi
738+
remote_sha="$(git ls-remote origin "refs/heads/${{ github.ref_name }}" | awk '{print $1}' || true)"
739+
if [ -n "${remote_sha}" ] && [ "${remote_sha}" = "${local_sha}" ]; then
740+
echo "Remote branch already points at ${local_sha}; treating push as successful."
741+
break
742+
fi
722743
else
723744
echo "Rebase failed; aborting and retrying"
724745
git rebase --abort || true

0 commit comments

Comments
 (0)