From e0cf6d35534e8c107244f76b1d33e8fd5f595bf8 Mon Sep 17 00:00:00 2001 From: Victor <55268669+victor-wildlife@users.noreply.github.com> Date: Sun, 25 Aug 2024 09:20:58 +1200 Subject: [PATCH] deal with diverged histories Added Force Merge Upstream Changes to first detect changes from upstream, and if updates are required, perform the forced merge before creating the pull request. --- .github/workflows/check-upstream-updates.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/check-upstream-updates.yml b/.github/workflows/check-upstream-updates.yml index ca67f81d..0b1ed733 100644 --- a/.github/workflows/check-upstream-updates.yml +++ b/.github/workflows/check-upstream-updates.yml @@ -39,6 +39,11 @@ jobs: echo "status=up_to_date" >> $GITHUB_OUTPUT fi + - name: Force merge upstream changes + if: steps.check_updates.outputs.status == 'needs_update' + run: | + git merge upstream/main --allow-unrelated-histories -m "Merge upstream changes" + - name: Create Pull Request if: steps.check_updates.outputs.status == 'needs_update' uses: peter-evans/create-pull-request@v6