Skip to content

Commit 5db49d3

Browse files
committed
use local ci branch
1 parent faf7a39 commit 5db49d3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,17 @@ jobs:
169169

170170
- name: Checkout
171171
uses: actions/checkout@v4
172+
with:
173+
fetch-depth: 0
174+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
175+
176+
- name: Use local branch
177+
shell: bash
178+
run: |
179+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
180+
git branch -D $BRANCH 2>/dev/null || true
181+
git branch $BRANCH HEAD
182+
git checkout $BRANCH
172183
173184
- name: Install PHP with extensions
174185
uses: shivammathur/setup-php@v2
@@ -198,6 +209,17 @@ jobs:
198209
steps:
199210
- name: Checkout
200211
uses: actions/checkout@v4
212+
with:
213+
fetch-depth: 0
214+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
215+
216+
- name: Use local branch
217+
shell: bash
218+
run: |
219+
BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
220+
git branch -D $BRANCH 2>/dev/null || true
221+
git branch $BRANCH HEAD
222+
git checkout $BRANCH
201223
202224
- name: Install PHP with extensions
203225
uses: shivammathur/setup-php@v2

0 commit comments

Comments
 (0)