diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml index 83c2d7ff925..4b50c3b2043 100644 --- a/.github/workflows/patch.yml +++ b/.github/workflows/patch.yml @@ -171,7 +171,11 @@ jobs: update_to_version 16 3.14 echo "Updating to latest version" - git -C "apps/frappe" fetch --depth 1 upstream "${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" + # a stacked PR's base is an erpnext feature branch with no counterpart in frappe, + # so fall back to the repository's default branch + base_ref="${GITHUB_BASE_REF:-${GITHUB_REF##*/}}" + git -C "apps/frappe" fetch --depth 1 upstream "$base_ref" \ + || git -C "apps/frappe" fetch --depth 1 upstream develop git -C "apps/frappe" checkout -q -f FETCH_HEAD git -C "apps/erpnext" checkout -q -f "$GITHUB_SHA"