From 33fdaf6689a7feddbd5cc4c910df0a589159ea9b Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Mon, 5 Oct 2026 11:11:27 +0100 Subject: [PATCH] fix(autoupdate): skip a branch whose lockfile the default branch also changed A lockfile changed on both sides merges as text and can come out broken, so a tested merge differs from the merge that lands. Skip the branch and let Renovate regenerate it on the next run. --- .github/workflows/renovate-autoupdate.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/renovate-autoupdate.yaml b/.github/workflows/renovate-autoupdate.yaml index 761239a..1384e83 100644 --- a/.github/workflows/renovate-autoupdate.yaml +++ b/.github/workflows/renovate-autoupdate.yaml @@ -337,7 +337,21 @@ jobs: echo "::notice::$BRANCH is already in the default branch." echo "skip=true" >> "$GITHUB_OUTPUT" elif git merge --no-ff --no-commit FETCH_HEAD; then - echo "skip=false" >> "$GITHUB_OUTPUT" + # A lockfile that both sides changed merges as text and can be broken. Renovate regenerates it on the next run. + base=$(git merge-base HEAD FETCH_HEAD) + stale="" + for lock in pnpm-lock.yaml package-lock.json yarn.lock; do + for f in $(git ls-tree -r --name-only FETCH_HEAD | grep -E "(^|/)${lock//./\\.}$"); do + if ! git diff --quiet "$base" HEAD -- "$f" && ! git diff --quiet "$base" FETCH_HEAD -- "$f"; then stale="$stale $f"; fi + done + done + if [ -n "$stale" ]; then + git merge --abort + echo "::warning::$BRANCH and the default branch both changed${stale}. Renovate rebases it on the next run." + echo "skip=true" >> "$GITHUB_OUTPUT" + else + echo "skip=false" >> "$GITHUB_OUTPUT" + fi else git merge --abort echo "::warning::$BRANCH conflicts with the default branch. Renovate rebases it on the next run."