Skip to content

Commit

Permalink
Fix: enhance PR merge workflow by ensuring branch cleanup before fetc…
Browse files Browse the repository at this point in the history
…hing
  • Loading branch information
NripeshN committed Jan 3, 2025
1 parent 8f09523 commit 830485a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/PR_merge_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ jobs:

- name: Fetch PR branch and main
run: |
# Fetch the PR branch and the main branch
# Check if the branch already exists and delete it if necessary
if git rev-parse --verify pr-branch; then
git branch -D pr-branch
fi
# Fetch the PR branch and create a local branch
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-branch
git fetch origin main
git checkout -b pr-branch FETCH_HEAD
# Fetch the main branch
git fetch origin main
- name: Set git user
run: |
Expand Down

0 comments on commit 830485a

Please sign in to comment.