@@ -142,6 +142,20 @@ jobs:
142142 with :
143143 persist-credentials : false
144144 submodules : true
145+ - name : Checkout swiftlang/github-workflows repository
146+ if : ${{ github.repository != 'swiftlang/github-workflows' }}
147+ uses : actions/checkout@v4
148+ with :
149+ repository : swiftlang/github-workflows
150+ path : github-workflows
151+ - name : Determine script-root path
152+ id : script_path
153+ run : |
154+ if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
155+ echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
156+ else
157+ echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
158+ fi
145159 - name : Pre-build
146160 if : ${{ inputs.linux_pre_build_command }}
147161 run : ${{ inputs.linux_pre_build_command }}
@@ -150,7 +164,7 @@ jobs:
150164 ADDITIONAL_DOCC_ARGUMENTS : ${{ inputs.docs_check_additional_arguments }}
151165 run : |
152166 which curl yq || (apt -q update && apt -yq install curl yq)
153- curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main /.github/workflows/scripts/check-docs.sh | bash
167+ cat ${{ steps.script_path.outputs.root }} /.github/workflows/scripts/check-docs.sh | bash
154168
155169 unacceptable-language-check :
156170 name : Unacceptable language check
@@ -163,10 +177,24 @@ jobs:
163177 with :
164178 persist-credentials : false
165179 submodules : true
180+ - name : Checkout swiftlang/github-workflows repository
181+ if : ${{ github.repository != 'swiftlang/github-workflows' }}
182+ uses : actions/checkout@v4
183+ with :
184+ repository : swiftlang/github-workflows
185+ path : github-workflows
186+ - name : Determine script-root path
187+ id : script_path
188+ run : |
189+ if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
190+ echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
191+ else
192+ echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
193+ fi
166194 - name : Run unacceptable language check
167195 env :
168196 UNACCEPTABLE_WORD_LIST : ${{ inputs.unacceptable_language_check_word_list}}
169- run : curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main /.github/workflows/scripts/check-unacceptable-language.sh | bash
197+ run : cat ${{ steps.script_path.outputs.root }} /.github/workflows/scripts/check-unacceptable-language.sh | bash
170198
171199 license-header-check :
172200 name : License headers check
@@ -179,10 +207,24 @@ jobs:
179207 with :
180208 persist-credentials : false
181209 submodules : true
210+ - name : Checkout swiftlang/github-workflows repository
211+ if : ${{ github.repository != 'swiftlang/github-workflows' }}
212+ uses : actions/checkout@v4
213+ with :
214+ repository : swiftlang/github-workflows
215+ path : github-workflows
216+ - name : Determine script-root path
217+ id : script_path
218+ run : |
219+ if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
220+ echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
221+ else
222+ echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
223+ fi
182224 - name : Run license header check
183225 env :
184226 PROJECT_NAME : ${{ inputs.license_header_check_project_name }}
185- run : curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main /.github/workflows/scripts/check-license-header.sh | bash
227+ run : cat ${{ steps.script_path.outputs.root }} /.github/workflows/scripts/check-license-header.sh | bash
186228
187229 broken-symlink-check :
188230 name : Broken symlinks check
@@ -195,8 +237,22 @@ jobs:
195237 with :
196238 persist-credentials : false
197239 submodules : true
240+ - name : Checkout swiftlang/github-workflows repository
241+ if : ${{ github.repository != 'swiftlang/github-workflows' }}
242+ uses : actions/checkout@v4
243+ with :
244+ repository : swiftlang/github-workflows
245+ path : github-workflows
246+ - name : Determine script-root path
247+ id : script_path
248+ run : |
249+ if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
250+ echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
251+ else
252+ echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
253+ fi
198254 - name : Run broken symlinks check
199- run : curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main /.github/workflows/scripts/check-broken-symlinks.sh | bash
255+ run : cat ${{ steps.script_path.outputs.root }} /.github/workflows/scripts/check-broken-symlinks.sh | bash
200256
201257 format-check :
202258 name : Format check
@@ -211,13 +267,27 @@ jobs:
211267 with :
212268 persist-credentials : false
213269 submodules : true
270+ - name : Checkout swiftlang/github-workflows repository
271+ if : ${{ github.repository != 'swiftlang/github-workflows' }}
272+ uses : actions/checkout@v4
273+ with :
274+ repository : swiftlang/github-workflows
275+ path : github-workflows
276+ - name : Determine script-root path
277+ id : script_path
278+ run : |
279+ if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
280+ echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
281+ else
282+ echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
283+ fi
214284 - name : Mark the workspace as safe
215285 # https://github.com/actions/checkout/issues/766
216286 run : git config --global --add safe.directory ${GITHUB_WORKSPACE}
217287 - name : Run format check
218288 run : |
219289 which curl || (apt -q update && apt -yq install curl)
220- curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main /.github/workflows/scripts/check-swift-format.sh | bash
290+ cat ${{ steps.script_path.outputs.root }} /.github/workflows/scripts/check-swift-format.sh | bash
221291
222292 shell-check :
223293 name : Shell check
@@ -251,13 +321,27 @@ jobs:
251321 with :
252322 persist-credentials : false
253323 submodules : true
324+ - name : Checkout swiftlang/github-workflows repository
325+ if : ${{ github.repository != 'swiftlang/github-workflows' }}
326+ uses : actions/checkout@v4
327+ with :
328+ repository : swiftlang/github-workflows
329+ path : github-workflows
330+ - name : Determine script-root path
331+ id : script_path
332+ run : |
333+ if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
334+ echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
335+ else
336+ echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
337+ fi
254338 - name : Run yamllint
255339 run : |
256340 which yamllint || (apt -q update && apt install -yq yamllint)
257341 cd ${GITHUB_WORKSPACE}
258342 if [ ! -f ".yamllint.yml" ]; then
259343 echo "Downloading default yamllint config file"
260- curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main /.github/workflows/configs/yamllint.yml > .yamllint.yml
344+ cat ${{ steps.script_path.outputs.root }} /.github/workflows/configs/yamllint.yml > .yamllint.yml
261345 fi
262346 yamllint --strict --config-file .yamllint.yml .
263347
@@ -272,12 +356,26 @@ jobs:
272356 with :
273357 persist-credentials : false
274358 submodules : true
359+ - name : Checkout swiftlang/github-workflows repository
360+ if : ${{ github.repository != 'swiftlang/github-workflows' }}
361+ uses : actions/checkout@v4
362+ with :
363+ repository : swiftlang/github-workflows
364+ path : github-workflows
365+ - name : Determine script-root path
366+ id : script_path
367+ run : |
368+ if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
369+ echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
370+ else
371+ echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
372+ fi
275373 - name : Run flake8
276374 run : |
277375 pip3 install flake8 flake8-import-order
278376 cd ${GITHUB_WORKSPACE}
279377 if [ ! -f ".flake8" ]; then
280378 echo "Downloading default flake8 config file"
281- curl -s --retry 3 https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main /.github/workflows/configs/.flake8 > .flake8
379+ cat ${{ steps.script_path.outputs.root }} /.github/workflows/configs/.flake8 > .flake8
282380 fi
283381 flake8
0 commit comments