4040 type : string
4141 description : " Container image for the matrix job. Defaults to matching latest Swift 6.2 Amazon Linux 2 image."
4242 default : " swift:6.2-amazonlinux2"
43+ matrix_linux_swift_container_image :
44+ type : string
45+ description : " Container image for the matrix job. Defaults to matching latest Swift 6.2 Amazon Linux 2 image."
46+ default : " swift:6.2-amazonlinux2"
4347
4448# # We are cancelling previously triggered workflow runs
4549concurrency :
@@ -111,10 +115,26 @@ jobs:
111115 container :
112116 image : ${{ matrix.swift.image }}
113117 steps :
114- - name : Checkout repository
115- uses : actions/checkout@v4
116- with :
117- persist-credentials : false
118+ # GitHub checkout action has a dep on NodeJS 20 which is not running on Amazonlinux2
119+ # workaround is to manually checkout the repository
120+ # https://github.com/actions/checkout/issues/1487
121+ - name : Manually Clone repository and checkout PR
122+ env :
123+ PR_NUMBER : ${{ github.event.pull_request.number }}
124+ run : |
125+ # Clone the repository
126+ git clone https://github.com/${{ github.repository }}
127+ cd ${{ github.event.repository.name }}
128+
129+ # Fetch the pull request
130+ git fetch origin +refs/pull/$PR_NUMBER/merge:
131+
132+ # Checkout the pull request
133+ git checkout -qf FETCH_HEAD
134+ # - name: Checkout repository
135+ # uses: actions/checkout@v4
136+ # with:
137+ # persist-credentials: false
118138 - name : Mark the workspace as safe
119139 # https://github.com/actions/checkout/issues/766
120140 run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
@@ -131,10 +151,26 @@ jobs:
131151 container :
132152 image : ${{ inputs.matrix_linux_swift_container_image }}
133153 steps :
134- - name : Checkout repository
135- uses : actions/checkout@v4
136- with :
137- persist-credentials : false
154+ # GitHub checkout action has a dep on NodeJS 20 which is not running on Amazonlinux2
155+ # workaround is to manually checkout the repository
156+ # https://github.com/actions/checkout/issues/1487
157+ - name : Manually Clone repository and checkout PR
158+ env :
159+ PR_NUMBER : ${{ github.event.pull_request.number }}
160+ run : |
161+ # Clone the repository
162+ git clone https://github.com/${{ github.repository }}
163+ cd ${{ github.event.repository.name }}
164+
165+ # Fetch the pull request
166+ git fetch origin +refs/pull/$PR_NUMBER/merge:
167+
168+ # Checkout the pull request
169+ git checkout -qf FETCH_HEAD
170+ # - name: Checkout repository
171+ # uses: actions/checkout@v4
172+ # with:
173+ # persist-credentials: false
138174 - name : Mark the workspace as safe
139175 # https://github.com/actions/checkout/issues/766
140176 run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
0 commit comments