From 67b51347a350a70ebbabdc76f984f600921618e4 Mon Sep 17 00:00:00 2001 From: konstantinos Date: Sun, 18 Aug 2024 23:27:49 +0300 Subject: [PATCH] ci: fix logic by tracking remote release before merging into test --- .github/workflows/_gitops-merge-to-main.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_gitops-merge-to-main.yml b/.github/workflows/_gitops-merge-to-main.yml index 9a4e384..57f5f3f 100644 --- a/.github/workflows/_gitops-merge-to-main.yml +++ b/.github/workflows/_gitops-merge-to-main.yml @@ -38,12 +38,16 @@ jobs: token: ${{ secrets.GA_WORKFLOWS_CI_PR_RW_AND_ACTIONS_RW }} # Merge 'release' into 'test' branch - - name: Merge 'release' into 'test' branch + - name: Merge '${{ vars.GIT_RELEASE_BRANCH || 'release' }}' into 'test' branch + env: + release: ${{ vars.GIT_RELEASE_BRANCH || 'release' }} run: | - git merge --no-edit ${{ vars.GIT_RELEASE_BRANCH || 'release' }} + git branch --track "${{ env.release }}" "origin/${{ env.release }}" + git merge --no-edit "${{ env.release }}" git push origin ${{ vars.GIT_TEST_BRANCH || 'test' }} auto_merge_pr_to_main: + needs: put_test_branch_to_head uses: ./.github/workflows/go-auto-merge-main.yml with: main_branch: ${{ vars.GIT_MAIN_BRANCH || 'main' }}