diff --git a/.github/workflows/cherryPick.yml b/.github/workflows/cherryPick.yml index caab22ba2679..e06b55d3ab66 100644 --- a/.github/workflows/cherryPick.yml +++ b/.github/workflows/cherryPick.yml @@ -68,6 +68,7 @@ jobs: - name: Cherry-pick the version-bump to staging run: | # Find the commit for the version-bump + git fetch origin main git switch main VERSION_BUMP_COMMIT="$(git log --format='%H' --author='OSBotify' --grep 'Update version to ${{ env.NEW_VERSION }}')" diff --git a/.github/workflows/finishReleaseCycle.yml b/.github/workflows/finishReleaseCycle.yml index bd7a4eea8ab6..828f27a483e5 100644 --- a/.github/workflows/finishReleaseCycle.yml +++ b/.github/workflows/finishReleaseCycle.yml @@ -70,15 +70,10 @@ jobs: - name: Update production branch run: | - # Get the production branch locally - git switch production - - # Delete the production branch and re-create it from staging - git switch staging - git branch -D production + # Re-create the production branch from staging git switch -c production - # Force-update push the new production branch. + # Force-update the remote production branch. git push --force origin production - if: ${{ failure() }} @@ -111,15 +106,10 @@ jobs: - name: Update staging branch to trigger staging deploy run: | - # Get the staging branch locally - git switch staging - - # Delete the staging branch and re-create it from main - git switch main - git branch -D staging + # Re-create the staging branch from main git switch -c staging - # Force-update the updated staging branch + # Force-update the remote staging branch git push --force origin staging - if: ${{ failure() }} diff --git a/.github/workflows/preDeploy.yml b/.github/workflows/preDeploy.yml index ac5e21ffd94c..ef97788d3bef 100644 --- a/.github/workflows/preDeploy.yml +++ b/.github/workflows/preDeploy.yml @@ -100,12 +100,7 @@ jobs: - name: Update staging branch from main if: ${{ !fromJSON(needs.chooseDeployActions.outputs.SHOULD_CP) }} run: | - # Get the staging branch locally - git switch staging - - # Delete the staging branch and re-create it from main - git switch main - git branch -D staging + # Re-create the staging branch from main git switch -c staging # Force-update the remote staging branch