From e9b53cc83ee51b906423ec2e1fac36e159d55db2 Mon Sep 17 00:00:00 2001 From: lokeshrangineni <19699092+lokeshrangineni@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:27:51 -0500 Subject: [PATCH] feat: Creating/updating the stable branch after the release. (#5003) * Creating/updating the stable branch after the release. Signed-off-by: lrangine <19699092+lokeshrangineni@users.noreply.github.com> * Update .github/workflows/release.yml Co-authored-by: Francisco Arceo Signed-off-by: lrangine <19699092+lokeshrangineni@users.noreply.github.com> * Update .github/workflows/release.yml Co-authored-by: Francisco Arceo Signed-off-by: lrangine <19699092+lokeshrangineni@users.noreply.github.com> --------- Signed-off-by: lrangine <19699092+lokeshrangineni@users.noreply.github.com> Co-authored-by: Francisco Arceo --- .github/workflows/release.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5e95950cbe..bfb5e382f7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -156,7 +156,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - persist-credentials: false + persist-credentials: true - name: Setup Node.js uses: actions/setup-node@v3 with: @@ -179,3 +179,12 @@ 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. + if: github.event.inputs.dry_run == 'false' + 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