Skip to content

Commit 4b2f445

Browse files
committed
Handle 'if-no-files-found'.
1 parent 577899a commit 4b2f445

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

.github/workflows/ArtifactsUpload.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
**/*.py
8787
8888
Build-single-file:
89-
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
89+
name: ${{ matrix.os.icon }} Build single-file on ${{ matrix.os.name }} - Upload artifact
9090
runs-on: ${{ matrix.os.image }}
9191
strategy:
9292
fail-fast: false
@@ -121,7 +121,7 @@ jobs:
121121
document1.txt
122122
123123
Build-single-file-in-directory:
124-
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
124+
name: ${{ matrix.os.icon }} Build single-file-in-directory on ${{ matrix.os.name }} - Upload artifact
125125
runs-on: ${{ matrix.os.image }}
126126
strategy:
127127
fail-fast: false
@@ -156,7 +156,7 @@ jobs:
156156
bin/program.py
157157
158158
Build-double-file-in-directory:
159-
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
159+
name: ${{ matrix.os.icon }} Build double-file-in-directory on ${{ matrix.os.name }} - Upload artifact
160160
runs-on: ${{ matrix.os.image }}
161161
strategy:
162162
fail-fast: false
@@ -193,7 +193,7 @@ jobs:
193193
bin/tool.py
194194
195195
Build-triple-file-in-directory:
196-
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
196+
name: ${{ matrix.os.icon }} Build triple-file-in-directory on ${{ matrix.os.name }} - Upload artifact
197197
runs-on: ${{ matrix.os.image }}
198198
strategy:
199199
fail-fast: false
@@ -232,7 +232,7 @@ jobs:
232232
lib/gui/dialog.py
233233
234234
Build-double-file-in-deep-directory:
235-
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
235+
name: ${{ matrix.os.icon }} Build double-file-in-deep-directory on ${{ matrix.os.name }} - Upload artifact
236236
runs-on: ${{ matrix.os.image }}
237237
strategy:
238238
fail-fast: false
@@ -269,7 +269,7 @@ jobs:
269269
lib/gui/dialog.py
270270
271271
Build-single-directory:
272-
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
272+
name: ${{ matrix.os.icon }} Build single-directory on ${{ matrix.os.name }} - Upload artifact
273273
runs-on: ${{ matrix.os.image }}
274274
strategy:
275275
fail-fast: false
@@ -304,7 +304,7 @@ jobs:
304304
bin
305305
306306
Build-double-directory:
307-
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
307+
name: ${{ matrix.os.icon }} Build double-directory on ${{ matrix.os.name }} - Upload artifact
308308
runs-on: ${{ matrix.os.image }}
309309
strategy:
310310
fail-fast: false

action.yml

+13
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,19 @@ runs:
236236
printf " %s\n" "${ANSI_CYAN}Directories: ${dirCount}${ANSI_NOCOLOR}"
237237
printf " %s\n" "${ANSI_CYAN}Files: ${fileCount}${ANSI_NOCOLOR}"
238238
239+
if [[ $fileCount -eq 0 ]]; then
240+
if [[ "${{ inputs.if-no-files-found }}" == "error" ]]; then
241+
printf "::error title=%s::%s\n" "pyTooling/upload-artifact" "No files found for given pattern."
242+
exit 1
243+
elif [[ "${{ inputs.if-no-files-found }}" == "warn" ]]; then
244+
printf "::warning title=%s::%s\n" "pyTooling/upload-artifact" "No files found for given pattern."
245+
elif [[ "${{ inputs.if-no-files-found }}" == "ignore" ]]; then
246+
printf "%s\n" "No files found for given pattern."
247+
else
248+
printf "%s\n" "Unknown option '${{ inputs.if-no-files-found }}'."
249+
fi
250+
fi
251+
239252
- name: Remove dot-files if not explicitly included
240253
id: clean
241254
if: inputs.include-hidden-files == 'false'

0 commit comments

Comments
 (0)