40
40
type : string
41
41
description : " Container image for the matrix job. Defaults to matching latest Swift 6.2 Amazon Linux 2 image."
42
42
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"
43
47
44
48
# # We are cancelling previously triggered workflow runs
45
49
concurrency :
@@ -111,10 +115,26 @@ jobs:
111
115
container :
112
116
image : ${{ matrix.swift.image }}
113
117
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
118
138
- name : Mark the workspace as safe
119
139
# https://github.com/actions/checkout/issues/766
120
140
run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
@@ -131,10 +151,26 @@ jobs:
131
151
container :
132
152
image : ${{ inputs.matrix_linux_swift_container_image }}
133
153
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
138
174
- name : Mark the workspace as safe
139
175
# https://github.com/actions/checkout/issues/766
140
176
run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
0 commit comments