|
18 | 18 |
|
19 | 19 | steps: |
20 | 20 | - name: Checkout |
21 | | - uses: actions/checkout@v4 |
| 21 | + uses: actions/checkout@v5 |
| 22 | + with: |
| 23 | + fetch-depth: 1 |
| 24 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 25 | + |
| 26 | + - name: Use local branch |
| 27 | + shell: bash |
| 28 | + run: | |
| 29 | + BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}") |
| 30 | + git branch -D $BRANCH 2>/dev/null || true |
| 31 | + git branch $BRANCH HEAD |
| 32 | + git checkout $BRANCH |
22 | 33 |
|
23 | 34 | - name: Install PHP |
24 | 35 | uses: shivammathur/setup-php@v2 |
|
38 | 49 |
|
39 | 50 | steps: |
40 | 51 | - name: Checkout |
41 | | - uses: actions/checkout@v4 |
| 52 | + uses: actions/checkout@v5 |
| 53 | + with: |
| 54 | + fetch-depth: 1 |
| 55 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 56 | + |
| 57 | + - name: Use local branch |
| 58 | + shell: bash |
| 59 | + run: | |
| 60 | + BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}") |
| 61 | + git branch -D $BRANCH 2>/dev/null || true |
| 62 | + git branch $BRANCH HEAD |
| 63 | + git checkout $BRANCH |
42 | 64 |
|
43 | 65 | - name: Install PHP |
44 | 66 | uses: shivammathur/setup-php@v2 |
@@ -87,7 +109,18 @@ jobs: |
87 | 109 | run: git config --global core.autocrlf false |
88 | 110 |
|
89 | 111 | - name: Checkout |
90 | | - uses: actions/checkout@v4 |
| 112 | + uses: actions/checkout@v5 |
| 113 | + with: |
| 114 | + fetch-depth: 1 |
| 115 | + ref: ${{ github.event.pull_request.head.sha || github.sha }} |
| 116 | + |
| 117 | + - name: Use local branch |
| 118 | + shell: bash |
| 119 | + run: | |
| 120 | + BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}") |
| 121 | + git branch -D $BRANCH 2>/dev/null || true |
| 122 | + git branch $BRANCH HEAD |
| 123 | + git checkout $BRANCH |
91 | 124 |
|
92 | 125 | - name: Install PHP with extensions |
93 | 126 | uses: shivammathur/setup-php@v2 |
|
0 commit comments