Skip to content

Commit 8ea4b40

Browse files
committed
Use local copy on action invocation
Fixes #220
1 parent e96b1ad commit 8ea4b40

1 file changed

Lines changed: 16 additions & 137 deletions

File tree

.github/workflows/soundness.yml

Lines changed: 16 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -158,31 +158,17 @@ jobs:
158158
timeout-minutes: 20
159159
steps:
160160
- name: Checkout repository
161-
uses: actions/checkout@v4
161+
uses: actions/checkout@v6
162162
with:
163163
persist-credentials: false
164164
submodules: true
165-
- name: Checkout swiftlang/github-workflows repository
166-
if: ${{ github.repository != 'swiftlang/github-workflows' }}
167-
uses: actions/checkout@v4
168-
with:
169-
repository: swiftlang/github-workflows
170-
path: github-workflows
171-
- name: Determine script-root path
172-
id: script_path
173-
run: |
174-
if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
175-
echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
176-
else
177-
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
178-
fi
179165
- name: Pre-build
180166
if: ${{ inputs.linux_pre_build_command }}
181167
run: ${{ inputs.linux_pre_build_command }}
182168
- name: Run documentation check
183169
env:
184170
ADDITIONAL_DOCC_ARGUMENTS: ${{ inputs.docs_check_additional_arguments }}
185-
run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-docs.sh
171+
run: $GITHUB_ACTION_PATH/.github/workflows/scripts/check-docs.sh
186172

187173
docs-check-macos:
188174
name: Documentation check (macOS)
@@ -191,24 +177,10 @@ jobs:
191177
timeout-minutes: 20
192178
steps:
193179
- name: Checkout repository
194-
uses: actions/checkout@v4
180+
uses: actions/checkout@v6
195181
with:
196182
persist-credentials: false
197183
submodules: true
198-
- name: Checkout swiftlang/github-workflows repository
199-
if: ${{ github.repository != 'swiftlang/github-workflows' }}
200-
uses: actions/checkout@v4
201-
with:
202-
repository: swiftlang/github-workflows
203-
path: github-workflows
204-
- name: Determine script-root path
205-
id: script_path
206-
run: |
207-
if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
208-
echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
209-
else
210-
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
211-
fi
212184
- name: Select Xcode
213185
run: echo "DEVELOPER_DIR=/Applications/Xcode_${{ inputs.docs_check_macos_xcode_version }}.app" >> $GITHUB_ENV
214186
- name: Swift version
@@ -218,7 +190,7 @@ jobs:
218190
- name: Run documentation check
219191
env:
220192
ADDITIONAL_DOCC_ARGUMENTS: ${{ inputs.docs_check_macos_additional_arguments }}
221-
run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-docs.sh
193+
run: $GITHUB_ACTION_PATH/.github/workflows/scripts/check-docs.sh
222194

223195
unacceptable-language-check:
224196
name: Unacceptable language check
@@ -227,28 +199,14 @@ jobs:
227199
timeout-minutes: 1
228200
steps:
229201
- name: Checkout repository
230-
uses: actions/checkout@v4
202+
uses: actions/checkout@v6
231203
with:
232204
persist-credentials: false
233205
submodules: true
234-
- name: Checkout swiftlang/github-workflows repository
235-
if: ${{ github.repository != 'swiftlang/github-workflows' }}
236-
uses: actions/checkout@v4
237-
with:
238-
repository: swiftlang/github-workflows
239-
path: github-workflows
240-
- name: Determine script-root path
241-
id: script_path
242-
run: |
243-
if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
244-
echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
245-
else
246-
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
247-
fi
248206
- name: Run unacceptable language check
249207
env:
250208
UNACCEPTABLE_WORD_LIST: ${{ inputs.unacceptable_language_check_word_list}}
251-
run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-unacceptable-language.sh
209+
run: $GITHUB_ACTION_PATH/.github/workflows/scripts/check-unacceptable-language.sh
252210

253211
license-header-check:
254212
name: License headers check
@@ -257,28 +215,14 @@ jobs:
257215
timeout-minutes: 1
258216
steps:
259217
- name: Checkout repository
260-
uses: actions/checkout@v4
218+
uses: actions/checkout@v6
261219
with:
262220
persist-credentials: false
263221
submodules: true
264-
- name: Checkout swiftlang/github-workflows repository
265-
if: ${{ github.repository != 'swiftlang/github-workflows' }}
266-
uses: actions/checkout@v4
267-
with:
268-
repository: swiftlang/github-workflows
269-
path: github-workflows
270-
- name: Determine script-root path
271-
id: script_path
272-
run: |
273-
if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
274-
echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
275-
else
276-
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
277-
fi
278222
- name: Run license header check
279223
env:
280224
PROJECT_NAME: ${{ inputs.license_header_check_project_name }}
281-
run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-license-header.sh
225+
run: $GITHUB_ACTION_PATH/.github/workflows/scripts/check-license-header.sh
282226

283227
broken-symlink-check:
284228
name: Broken symlinks check
@@ -287,26 +231,12 @@ jobs:
287231
timeout-minutes: 1
288232
steps:
289233
- name: Checkout repository
290-
uses: actions/checkout@v4
234+
uses: actions/checkout@v6
291235
with:
292236
persist-credentials: false
293237
submodules: true
294-
- name: Checkout swiftlang/github-workflows repository
295-
if: ${{ github.repository != 'swiftlang/github-workflows' }}
296-
uses: actions/checkout@v4
297-
with:
298-
repository: swiftlang/github-workflows
299-
path: github-workflows
300-
- name: Determine script-root path
301-
id: script_path
302-
run: |
303-
if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
304-
echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
305-
else
306-
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
307-
fi
308238
- name: Run broken symlinks check
309-
run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-broken-symlinks.sh
239+
run: $GITHUB_ACTION_PATH/.github/workflows/scripts/check-broken-symlinks.sh
310240

311241
format-check:
312242
name: Format check
@@ -317,29 +247,15 @@ jobs:
317247
timeout-minutes: 20
318248
steps:
319249
- name: Checkout repository
320-
uses: actions/checkout@v4
250+
uses: actions/checkout@v6
321251
with:
322252
persist-credentials: false
323253
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
338254
- name: Mark the workspace as safe
339255
# https://github.com/actions/checkout/issues/766
340256
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
341257
- name: Run format check
342-
run: ${{ steps.script_path.outputs.root }}/.github/workflows/scripts/check-swift-format.sh
258+
run: $GITHUB_ACTION_PATH/.github/workflows/scripts/check-swift-format.sh
343259

344260
shell-check:
345261
name: Shell check
@@ -371,33 +287,14 @@ jobs:
371287
timeout-minutes: 5
372288
steps:
373289
- name: Checkout repository
374-
uses: actions/checkout@v4
290+
uses: actions/checkout@v6
375291
with:
376292
persist-credentials: false
377293
submodules: true
378-
- name: Checkout swiftlang/github-workflows repository
379-
if: ${{ github.repository != 'swiftlang/github-workflows' }}
380-
uses: actions/checkout@v4
381-
with:
382-
repository: swiftlang/github-workflows
383-
path: github-workflows
384-
- name: Determine script-root path
385-
id: script_path
386-
run: |
387-
if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
388-
echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
389-
else
390-
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
391-
fi
392294
- name: Run yamllint
393295
run: |
394296
which yamllint || (apt -q update && apt install -yq yamllint)
395-
cd ${GITHUB_WORKSPACE}
396-
if [ ! -f ".yamllint.yml" ]; then
397-
echo "Downloading default yamllint config file"
398-
cat ${{ steps.script_path.outputs.root }}/.github/workflows/configs/yamllint.yml > .yamllint.yml
399-
fi
400-
yamllint --strict --config-file .yamllint.yml .
297+
yamllint --strict --config-file $GITHUB_ACTION_PATH/.github/workflows/configs/yamllint.yml .
401298
402299
python-lint-check:
403300
name: Python lint check
@@ -406,30 +303,12 @@ jobs:
406303
timeout-minutes: 5
407304
steps:
408305
- name: Checkout repository
409-
uses: actions/checkout@v4
306+
uses: actions/checkout@v6
410307
with:
411308
persist-credentials: false
412309
submodules: true
413-
- name: Checkout swiftlang/github-workflows repository
414-
if: ${{ github.repository != 'swiftlang/github-workflows' }}
415-
uses: actions/checkout@v4
416-
with:
417-
repository: swiftlang/github-workflows
418-
path: github-workflows
419-
- name: Determine script-root path
420-
id: script_path
421-
run: |
422-
if [ "${{ github.repository }}" = "swiftlang/github-workflows" ]; then
423-
echo "root=$GITHUB_WORKSPACE" >> $GITHUB_OUTPUT
424-
else
425-
echo "root=$GITHUB_WORKSPACE/github-workflows" >> $GITHUB_OUTPUT
426-
fi
427310
- name: Run flake8
428311
run: |
429312
pip3 install flake8 flake8-import-order
430-
cd ${GITHUB_WORKSPACE}
431-
if [ ! -f ".flake8" ]; then
432-
echo "Downloading default flake8 config file"
433-
cat ${{ steps.script_path.outputs.root }}/.github/workflows/configs/.flake8 > .flake8
434-
fi
313+
cp $GITHUB_ACTION_PATH/.github/workflows/configs/.flake8 > .flake8
435314
flake8

0 commit comments

Comments
 (0)