Skip to content

Commit 7335e26

Browse files
feat: Changing refresh stable branch from step to a job. Using github credentials bot so that we can push the changes. (#5011)
Changing refresh stable branch from step to a job. Using github credentials bot so that we can push the changes. Signed-off-by: lrangine <19699092+lokeshrangineni@users.noreply.github.com>
1 parent aa7224a commit 7335e26

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

.github/workflows/release.yml

+28-6
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,33 @@ jobs:
179179
if: github.event.inputs.dry_run == 'false'
180180
run: |
181181
npx -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p semantic-release semantic-release
182+
182183
183-
- name: Updating `stable` branch after release.
184+
update_stable_branch:
185+
name: Update Stable Branch after release
186+
runs-on: ubuntu-latest
187+
needs: release
188+
env:
189+
GITHUB_TOKEN: ${{ github.event.inputs.token }}
190+
GIT_AUTHOR_NAME: feast-ci-bot
191+
GIT_AUTHOR_EMAIL: feast-ci-bot@willem.co
192+
GIT_COMMITTER_NAME: feast-ci-bot
193+
GIT_COMMITTER_EMAIL: feast-ci-bot@willem.co
194+
steps:
195+
- name: Checkout code
196+
uses: actions/checkout@v4
197+
with:
198+
persist-credentials: false
199+
200+
- name: Set up Git credentials
201+
run: |
202+
git config --global user.name "$GIT_AUTHOR_NAME"
203+
git config --global user.email "$GIT_AUTHOR_EMAIL"
204+
205+
- name: Fetch all branches
206+
run: git fetch --all
207+
208+
- name: Reset stable branch to match release branch
184209
run: |
185-
git fetch origin
186-
# note that this checkout creates a branch called `stable` if it does not exist
187-
git checkout -B stable
188-
git reset --hard origin/${GITHUB_REF##*/}
189-
git push -f origin stable
210+
git checkout -B stable origin/${GITHUB_REF#refs/heads/}
211+
git push origin stable --force

0 commit comments

Comments
 (0)