From 4828bcfde31801d48f24f957eab60ec3d88823a0 Mon Sep 17 00:00:00 2001 From: gilesb Date: Mon, 23 Oct 2023 16:55:35 +0100 Subject: [PATCH] .. --- .gitea/workflows/build->develop.yml | 20 +++++++++++++++++--- .gitea/workflows/develop -> build.yml | 20 +++++++++++++++++--- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build->develop.yml b/.gitea/workflows/build->develop.yml index cf57a2e..859a903 100644 --- a/.gitea/workflows/build->develop.yml +++ b/.gitea/workflows/build->develop.yml @@ -59,9 +59,23 @@ jobs: echo 'pushed new branch and created pr'; else if [[ $(git diff origin/${{ env.DEVELOPMENT_BRANCH }} | wc -c) -ne 0 ]]; then - git merge -X ours origin/${{ env.DEVELOPMENT_BRANCH }} - git commit -m "merged" - # git rebase origin/${{ env.DEVELOPMENT_BRANCH }} --strategy-option ours --force-rebase + git clone ${{ github.serverUrl }}/${{ github.repository }} ../cloned + git -C ../cloned fetch origin #--depth=1 + git -C ../cloned branch -r + git -C ../cloned checkout $DEVELOPMENT_BRANCH || git -C ../cloned checkout -b $DEVELOPMENT_BRANCH + mv ../cloned/.git .. + rm -rf ../cloned + cp -r . ../cloned + rm -rf ../cloned/.git + mv ../.git ../cloned + mv .git/config ../cloned/.git + rm -r ./* + rm -r .git + mv ../cloned/* . + mv ../cloned/.git . + git status + git add -A + git commit -a -m "${{ github.ref_name }} -> ${{ env.DEVELOPMENT_BRANCH }}" git push origin HEAD:${{ env.DEVELOPMENT_BRANCH }}; else echo 'no changes so no push' diff --git a/.gitea/workflows/develop -> build.yml b/.gitea/workflows/develop -> build.yml index cd2091a..8af12e1 100644 --- a/.gitea/workflows/develop -> build.yml +++ b/.gitea/workflows/develop -> build.yml @@ -43,9 +43,23 @@ jobs: git push origin HEAD:${{ env.BUILD_BRANCH }}; else if [[ $(git diff origin/${{ env.BUILD_BRANCH }} | wc -c) -ne 0 ]]; then - git merge -X ours origin/${{ env.BUILD_BRANCH }} - git commit -m "megerd" - # git rebase origin/${{ env.BUILD_BRANCH }} --strategy-option ours + git clone ${{ github.serverUrl }}/${{ github.repository }} ../cloned + git -C ../cloned fetch origin #--depth=1 + git -C ../cloned branch -r + git -C ../cloned checkout $BUILD_BRANCH || git -C ../cloned checkout -b $BUILD_BRANCH + mv ../cloned/.git .. + rm -rf ../cloned + cp -r . ../cloned + rm -rf ../cloned/.git + mv ../.git ../cloned + mv .git/config ../cloned/.git + rm -r ./* + rm -r .git + mv ../cloned/* . + mv ../cloned/.git . + git status + git add -A + git commit -a -m "${{ github.ref_name }} -> ${{ env.BUILD_BRANCH }} " git push origin HEAD:${{ env.BUILD_BRANCH }} else echo 'no changes so no push'