File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,23 @@ jobs:
2424 run : |
2525 cd /home/integration/git/cardano-rosetta-java
2626
27+ # Fetch latest from remote
28+ git fetch origin
29+
2730 # Clean up any existing PR branch and switch to main first
2831 git checkout main || git checkout develop
29- git branch -D pr-${{ github.event.pull_request.number }} 2>/dev/null || true
32+ git pull origin main || git pull origin develop
3033
31- # Fetch and checkout the PR
32- git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }}
33- git checkout pr-${{ github.event.pull_request.number }}
34+ # Checkout appropriate branch based on trigger type
35+ if [ "${{ github.event_name }}" = "pull_request" ]; then
36+ git branch -D pr-${{ github.event.pull_request.number }} 2>/dev/null || true
37+ git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }}
38+ git checkout pr-${{ github.event.pull_request.number }}
39+ else
40+ # workflow_dispatch: checkout the selected branch
41+ git checkout ${{ github.ref_name }}
42+ git pull origin ${{ github.ref_name }}
43+ fi
3444
3545 - name : Stop current services
3646 run : |
You can’t perform that action at this time.
0 commit comments