@@ -43,18 +43,27 @@ jobs:
43
43
container :
44
44
image : ${{ matrix.swift.image }}
45
45
steps :
46
- - name : Checkout repository
47
- # GitHub checkout action has a dep on NodeJS 20 which is not running on Amazonlinux2
48
- # workaround is to manually checkout the repository
49
- # https://github.com/actions/checkout/issues/1487
50
46
51
- # uses: actions/checkout@v4
52
- # with:
53
- # persist-credentials: false
47
+ # GitHub checkout action has a dep on NodeJS 20 which is not running on Amazonlinux2
48
+ # workaround is to manually checkout the repository
49
+ # https://github.com/actions/checkout/issues/1487
50
+ - name : Manually Clone repository and checkout PR
51
+ env :
52
+ PR_NUMBER : ${{ github.event.pull_request.number }}
54
53
run : |
55
- git clone https://github.com/${{ github.repository }}
56
- cd ${{ github.event.repository.name }}
57
- git checkout ${{ github.ref }}
54
+ # Clone the repository
55
+ git clone https://github.com/${{ github.repository }}.git .
56
+
57
+ # Fetch the pull request
58
+ git fetch origin +refs/pull/$PR_NUMBER/merge:
59
+
60
+ # Checkout the pull request
61
+ git checkout -qf FETCH_HEAD
62
+
63
+ # - name: Checkout repository
64
+ # uses: actions/checkout@v4
65
+ # with:
66
+ # persist-credentials: false
58
67
59
68
- name : Mark the workspace as safe
60
69
working-directory : ${{ github.event.repository.name }} # until we can use action/checkout@v4
0 commit comments