diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index acefac7250..d76be8506f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -179,11 +179,33 @@ jobs: if: github.event.inputs.dry_run == 'false' run: | npx -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p semantic-release semantic-release + - - name: Updating `stable` branch after release. + update_stable_branch: + name: Update Stable Branch after release + runs-on: ubuntu-latest + needs: release + env: + GITHUB_TOKEN: ${{ github.event.inputs.token }} + GIT_AUTHOR_NAME: feast-ci-bot + GIT_AUTHOR_EMAIL: feast-ci-bot@willem.co + GIT_COMMITTER_NAME: feast-ci-bot + GIT_COMMITTER_EMAIL: feast-ci-bot@willem.co + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Git credentials + run: | + git config --global user.name "$GIT_AUTHOR_NAME" + git config --global user.email "$GIT_AUTHOR_EMAIL" + + - name: Fetch all branches + run: git fetch --all + + - name: Reset stable branch to match release branch run: | - git fetch origin - # note that this checkout creates a branch called `stable` if it does not exist - git checkout -B stable - git reset --hard origin/${GITHUB_REF##*/} - git push -f origin stable \ No newline at end of file + git checkout -B stable origin/${GITHUB_REF#refs/heads/} + git push origin stable --force \ No newline at end of file