Skip to content

Commit

Permalink
Handle 'if-no-files-found'.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Dec 25, 2024
1 parent 577899a commit 5496c06
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ArtifactsUpload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
**/*.py
Build-single-file:
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
name: ${{ matrix.os.icon }} Build single-file on ${{ matrix.os.name }} - Upload artifact
runs-on: ${{ matrix.os.image }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
document1.txt
Build-single-file-in-directory:
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
name: ${{ matrix.os.icon }} Build single-file-in-directory on ${{ matrix.os.name }} - Upload artifact
runs-on: ${{ matrix.os.image }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
bin/program.py
Build-double-file-in-directory:
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
name: ${{ matrix.os.icon }} Build double-file-in-directory on ${{ matrix.os.name }} - Upload artifact
runs-on: ${{ matrix.os.image }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
bin/tool.py
Build-triple-file-in-directory:
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
name: ${{ matrix.os.icon }} Build triple-file-in-directory on ${{ matrix.os.name }} - Upload artifact
runs-on: ${{ matrix.os.image }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
lib/gui/dialog.py
Build-double-file-in-deep-directory:
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
name: ${{ matrix.os.icon }} Build double-file-in-deep-directory on ${{ matrix.os.name }} - Upload artifact
runs-on: ${{ matrix.os.image }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -269,7 +269,7 @@ jobs:
lib/gui/dialog.py
Build-single-directory:
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
name: ${{ matrix.os.icon }} Build single-directory on ${{ matrix.os.name }} - Upload artifact
runs-on: ${{ matrix.os.image }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -304,7 +304,7 @@ jobs:
bin
Build-double-directory:
name: ${{ matrix.os.icon }} Build 1 on ${{ matrix.os.name }} - Upload artifact
name: ${{ matrix.os.icon }} Build double-directory on ${{ matrix.os.name }} - Upload artifact
runs-on: ${{ matrix.os.image }}
strategy:
fail-fast: false
Expand Down
13 changes: 13 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,19 @@ runs:
printf " %s\n" "${ANSI_CYAN}Directories: ${dirCount}${ANSI_NOCOLOR}"
printf " %s\n" "${ANSI_CYAN}Files: ${fileCount}${ANSI_NOCOLOR}"
if [[ $fileCount -eq 0 ]]; then
if [[ "${{ inputs.if-no-files-found }}" == "error" ]]; then
printf "::error title=%s::%s\n" "${{ job.name }} - pyTooling/upload-artifact" "No files found for given pattern."
exit 1
elif [[ "${{ inputs.if-no-files-found }}" == "warn" ]]; then
printf "::warning title=%s::%s\n" "${{ job.name }} - pyTooling/upload-artifact" "No files found for given pattern."
elif [[ "${{ inputs.if-no-files-found }}" == "ignore" ]]; then
printf "%s\n" "No files found for given pattern."
else
printf "%s\n" "Unknown option '${{ inputs.if-no-files-found }}'."
fi
fi
- name: Remove dot-files if not explicitly included
id: clean
if: inputs.include-hidden-files == 'false'
Expand Down

0 comments on commit 5496c06

Please sign in to comment.