fix(iterate-workflow): safer push logic with force-with-lease and rebase
This commit is contained in:
parent
527a56d922
commit
c79e4c2bcb
|
|
@ -87,8 +87,9 @@ jobs:
|
||||||
--jq '.[0].number // empty')
|
--jq '.[0].number // empty')
|
||||||
|
|
||||||
if [ -n "$EXISTING_PR" ]; then
|
if [ -n "$EXISTING_PR" ]; then
|
||||||
git push origin HEAD:"$BRANCH" --force-with-lease 2>/dev/null || \
|
git fetch origin "$BRANCH" 2>/dev/null || true
|
||||||
git push origin HEAD:"$BRANCH"
|
git pull --rebase origin main
|
||||||
|
git push origin HEAD:"$BRANCH" --force-with-lease
|
||||||
{
|
{
|
||||||
cat docs/iterations/LEARNINGS.md
|
cat docs/iterations/LEARNINGS.md
|
||||||
echo ""
|
echo ""
|
||||||
|
|
@ -99,7 +100,7 @@ jobs:
|
||||||
echo "Updated existing PR #${EXISTING_PR}"
|
echo "Updated existing PR #${EXISTING_PR}"
|
||||||
else
|
else
|
||||||
git checkout -b "$BRANCH" 2>/dev/null || git checkout "$BRANCH"
|
git checkout -b "$BRANCH" 2>/dev/null || git checkout "$BRANCH"
|
||||||
git push -u origin "$BRANCH"
|
git push -u origin "$BRANCH" --force-with-lease
|
||||||
{
|
{
|
||||||
cat docs/iterations/LEARNINGS.md
|
cat docs/iterations/LEARNINGS.md
|
||||||
echo ""
|
echo ""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue