|
23 | 23 | steps: |
24 | 24 | - name: Checkout |
25 | 25 | uses: actions/checkout@v5 |
| 26 | + with: |
| 27 | + fetch-depth: 1 |
| 28 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 29 | + |
| 30 | + - name: Use local branch |
| 31 | + shell: bash |
| 32 | + run: | |
| 33 | + BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}") |
| 34 | + git branch -D $BRANCH 2>/dev/null || true |
| 35 | + git branch $BRANCH HEAD |
| 36 | + git checkout $BRANCH |
26 | 37 |
|
27 | 38 | - name: Install PHP |
28 | 39 | uses: shivammathur/setup-php@v2 |
|
47 | 58 | steps: |
48 | 59 | - name: Checkout |
49 | 60 | uses: actions/checkout@v5 |
| 61 | + with: |
| 62 | + fetch-depth: 1 |
| 63 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 64 | + |
| 65 | + - name: Use local branch |
| 66 | + shell: bash |
| 67 | + run: | |
| 68 | + BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}") |
| 69 | + git branch -D $BRANCH 2>/dev/null || true |
| 70 | + git branch $BRANCH HEAD |
| 71 | + git checkout $BRANCH |
50 | 72 |
|
51 | 73 | - name: Install PHP |
52 | 74 | uses: shivammathur/setup-php@v2 |
|
71 | 93 | steps: |
72 | 94 | - name: Checkout |
73 | 95 | uses: actions/checkout@v5 |
| 96 | + with: |
| 97 | + fetch-depth: 1 |
| 98 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 99 | + |
| 100 | + - name: Use local branch |
| 101 | + shell: bash |
| 102 | + run: | |
| 103 | + BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}") |
| 104 | + git branch -D $BRANCH 2>/dev/null || true |
| 105 | + git branch $BRANCH HEAD |
| 106 | + git checkout $BRANCH |
74 | 107 |
|
75 | 108 | - name: Install PHP |
76 | 109 | uses: shivammathur/setup-php@v2 |
@@ -123,6 +156,17 @@ jobs: |
123 | 156 |
|
124 | 157 | - name: Checkout |
125 | 158 | uses: actions/checkout@v5 |
| 159 | + with: |
| 160 | + fetch-depth: 1 |
| 161 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 162 | + |
| 163 | + - name: Use local branch |
| 164 | + shell: bash |
| 165 | + run: | |
| 166 | + BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}") |
| 167 | + git branch -D $BRANCH 2>/dev/null || true |
| 168 | + git branch $BRANCH HEAD |
| 169 | + git checkout $BRANCH |
126 | 170 |
|
127 | 171 | - name: Install PHP with extensions |
128 | 172 | uses: shivammathur/setup-php@v2 |
@@ -172,6 +216,17 @@ jobs: |
172 | 216 |
|
173 | 217 | - name: Checkout |
174 | 218 | uses: actions/checkout@v5 |
| 219 | + with: |
| 220 | + fetch-depth: 1 |
| 221 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 222 | + |
| 223 | + - name: Use local branch |
| 224 | + shell: bash |
| 225 | + run: | |
| 226 | + BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}") |
| 227 | + git branch -D $BRANCH 2>/dev/null || true |
| 228 | + git branch $BRANCH HEAD |
| 229 | + git checkout $BRANCH |
175 | 230 |
|
176 | 231 | - name: Install PHP with extensions |
177 | 232 | uses: shivammathur/setup-php@v2 |
@@ -199,6 +254,17 @@ jobs: |
199 | 254 | steps: |
200 | 255 | - name: Checkout |
201 | 256 | uses: actions/checkout@v5 |
| 257 | + with: |
| 258 | + fetch-depth: 1 |
| 259 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 260 | + |
| 261 | + - name: Use local branch |
| 262 | + shell: bash |
| 263 | + run: | |
| 264 | + BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}") |
| 265 | + git branch -D $BRANCH 2>/dev/null || true |
| 266 | + git branch $BRANCH HEAD |
| 267 | + git checkout $BRANCH |
202 | 268 |
|
203 | 269 | - name: Install PHP with extensions |
204 | 270 | uses: shivammathur/setup-php@v2 |
@@ -246,6 +312,17 @@ jobs: |
246 | 312 | steps: |
247 | 313 | - name: Checkout |
248 | 314 | uses: actions/checkout@v5 |
| 315 | + with: |
| 316 | + fetch-depth: 1 |
| 317 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 318 | + |
| 319 | + - name: Use local branch |
| 320 | + shell: bash |
| 321 | + run: | |
| 322 | + BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}") |
| 323 | + git branch -D $BRANCH 2>/dev/null || true |
| 324 | + git branch $BRANCH HEAD |
| 325 | + git checkout $BRANCH |
249 | 326 |
|
250 | 327 | - name: Install PHP with extensions |
251 | 328 | uses: shivammathur/setup-php@v2 |
@@ -306,6 +383,17 @@ jobs: |
306 | 383 | steps: |
307 | 384 | - name: Checkout |
308 | 385 | uses: actions/checkout@v5 |
| 386 | + with: |
| 387 | + fetch-depth: 1 |
| 388 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 389 | + |
| 390 | + - name: Use local branch |
| 391 | + shell: bash |
| 392 | + run: | |
| 393 | + BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}") |
| 394 | + git branch -D $BRANCH 2>/dev/null || true |
| 395 | + git branch $BRANCH HEAD |
| 396 | + git checkout $BRANCH |
309 | 397 |
|
310 | 398 | - name: Install PHP with extensions |
311 | 399 | uses: shivammathur/setup-php@v2 |
|
0 commit comments