diff --git a/.github/workflows/pr-backport-autotrigger.yml b/.github/workflows/pr-backport-autotrigger.yml index 00c21a9c85f7..05752b14701e 100644 --- a/.github/workflows/pr-backport-autotrigger.yml +++ b/.github/workflows/pr-backport-autotrigger.yml @@ -71,19 +71,11 @@ jobs: set -e echo "Backporting to beta ${{ steps.list-branches.outputs.beta }} and stable ${{ steps.list-branches.outputs.stable }}" - # Echo the merge commit SHA - echo "Merge commit SHA: ${{ github.event.pull_request.merge_commit_sha }}" - # Fetch all history for all branches and tags git fetch --prune - # Reset and prepare the beta branch + # Prepare the beta branch git checkout ${{ steps.list-branches.outputs.beta }} - git reset --hard origin/${{ steps.list-branches.outputs.beta }} - echo "Last 5 commits on beta branch:" - git log -n 5 --pretty=format:"%H" - - # Cherry-pick the merge commit from the merged PR git cherry-pick -m 1 ${{ github.event.pull_request.merge_commit_sha }} || { echo "Cherry-pick to beta failed due to conflicts." exit 1 @@ -92,15 +84,11 @@ jobs: # Create new beta branch/tag git tag ${{ steps.list-branches.outputs.new_beta_tag }} # Push the changes and tag to the beta branch using PAT - git push origin ${{ steps.list-branches.outputs.beta }} - git push origin ${{ steps.list-branches.outputs.new_beta_tag }} + git push origin ${{ steps.list-branches.outputs.beta }} --force + #git push origin ${{ steps.list-branches.outputs.new_beta_tag }} # This step does not trigger the workflow, better to do it manually for now - # Reset and prepare the stable branch + # Prepare the stable branch git checkout ${{ steps.list-branches.outputs.stable }} - git reset --hard origin/${{ steps.list-branches.outputs.stable }} - echo "Last 5 commits on stable branch:" - git log -n 5 --pretty=format:"%H" - # Cherry-pick the merge commit from the merged PR git cherry-pick -m 1 ${{ github.event.pull_request.merge_commit_sha }} || { echo "Cherry-pick to stable failed due to conflicts." @@ -110,5 +98,5 @@ jobs: # Create new stable branch/tag git tag ${{ steps.list-branches.outputs.new_stable_tag }} # Push the changes and tag to the stable branch using PAT - git push origin ${{ steps.list-branches.outputs.stable }} - git push origin ${{ steps.list-branches.outputs.new_stable_tag }} + git push origin ${{ steps.list-branches.outputs.stable }} --force + #git push origin ${{ steps.list-branches.outputs.new_stable_tag }} # This step does not trigger the workflow, better to do it manually for now