From a2ba0fe88b05ed1927b4c4fc6a8cd20e5d81e561 Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 10:51:06 -0700 Subject: [PATCH 01/14] Create pr_check.yml Testing automatic image reqts checking --- .github/workflows/pr_check.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/pr_check.yml diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml new file mode 100644 index 00000000..b8bb3229 --- /dev/null +++ b/.github/workflows/pr_check.yml @@ -0,0 +1,26 @@ +name: Check Images +on: + pull_request: + types: [opened] + +jobs: + check_images: + name: Check Images + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check Image Types + run: | + badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f | awk '{print $1}') \ + [[ ! -z "$badfiletypes" ]] && echo "Bad types found\n$badfiletypes" || echo "All files passed file type check" \ + [[ ! -z "$badfiletypes" ]] && exit 1 || exit 0 + - name: Check Image Filenames + run: | + badfilenames=$(find ${{ github.workspace }} -iregex '.\/.*[<>&:`"\|\?\\\/\*].*' -type f | awk '{print $1}') \ + [[ ! -z "$badfilenames" ]] && echo "Bad chars found\n$badfilenames" || echo "All files passed file names check" \ + [[ ! -z "$badfilenames" ]] && exit 1 || exit 0 + - name: Check Image Sizes + run: | + badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') \ + [[ ! -z "$badfilesizes" ]] && echo "Bad files found\n$badfilesizes" || echo "All files passed size check" \ + [[ ! -z "$badfilesizes" ]] && exit 1 || exit 0 From 0731eccd3741d7cb7a05925f4adb772df53656a1 Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 10:55:23 -0700 Subject: [PATCH 02/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index b8bb3229..42241fcc 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -12,15 +12,15 @@ jobs: - name: Check Image Types run: | badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f | awk '{print $1}') \ - [[ ! -z "$badfiletypes" ]] && echo "Bad types found\n$badfiletypes" || echo "All files passed file type check" \ - [[ ! -z "$badfiletypes" ]] && exit 1 || exit 0 + [[ ! -z "$badfiletypes" ]] && echo "Bad types found\n$badfiletypes" || echo "All files passed file type check" \ + [[ ! -z "$badfiletypes" ]] && exit 1 || exit 0 - name: Check Image Filenames run: | badfilenames=$(find ${{ github.workspace }} -iregex '.\/.*[<>&:`"\|\?\\\/\*].*' -type f | awk '{print $1}') \ - [[ ! -z "$badfilenames" ]] && echo "Bad chars found\n$badfilenames" || echo "All files passed file names check" \ - [[ ! -z "$badfilenames" ]] && exit 1 || exit 0 + [[ ! -z "$badfilenames" ]] && echo "Bad chars found\n$badfilenames" || echo "All files passed file names check" \ + [[ ! -z "$badfilenames" ]] && exit 1 || exit 0 - name: Check Image Sizes run: | badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') \ - [[ ! -z "$badfilesizes" ]] && echo "Bad files found\n$badfilesizes" || echo "All files passed size check" \ - [[ ! -z "$badfilesizes" ]] && exit 1 || exit 0 + [[ ! -z "$badfilesizes" ]] && echo "Bad files found\n$badfilesizes" || echo "All files passed size check" \ + [[ ! -z "$badfilesizes" ]] && exit 1 || exit 0 From 3a883073f8874b1ac2c3ff7363d833d11dfafbc3 Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 11:01:32 -0700 Subject: [PATCH 03/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 42241fcc..40468a88 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -12,15 +12,15 @@ jobs: - name: Check Image Types run: | badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f | awk '{print $1}') \ - [[ ! -z "$badfiletypes" ]] && echo "Bad types found\n$badfiletypes" || echo "All files passed file type check" \ - [[ ! -z "$badfiletypes" ]] && exit 1 || exit 0 + [[ ! -z "$badfiletypes" ]] && echo "Bad types found\n$badfiletypes" || echo "All files passed file type check" \ + [[ ! -z "$badfiletypes" ]] && exit 1 || exit 0 - name: Check Image Filenames run: | badfilenames=$(find ${{ github.workspace }} -iregex '.\/.*[<>&:`"\|\?\\\/\*].*' -type f | awk '{print $1}') \ - [[ ! -z "$badfilenames" ]] && echo "Bad chars found\n$badfilenames" || echo "All files passed file names check" \ - [[ ! -z "$badfilenames" ]] && exit 1 || exit 0 - - name: Check Image Sizes + [[ ! -z "$badfilenames" ]] && echo "Bad chars found\n$badfilenames" || echo "All files passed file names check" \ + [[ ! -z "$badfilenames" ]] && exit 1 || exit 0 + - name: Check Image Sizes run: | badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') \ - [[ ! -z "$badfilesizes" ]] && echo "Bad files found\n$badfilesizes" || echo "All files passed size check" \ - [[ ! -z "$badfilesizes" ]] && exit 1 || exit 0 + [[ ! -z "$badfilesizes" ]] && echo "Bad files found\n$badfilesizes" || echo "All files passed size check" \ + [[ ! -z "$badfilesizes" ]] && exit 1 || exit 0 From be8537659766652839201ad85116532ec3c067c5 Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 11:20:50 -0700 Subject: [PATCH 04/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 40468a88..93105332 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -12,15 +12,33 @@ jobs: - name: Check Image Types run: | badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f | awk '{print $1}') \ - [[ ! -z "$badfiletypes" ]] && echo "Bad types found\n$badfiletypes" || echo "All files passed file type check" \ - [[ ! -z "$badfiletypes" ]] && exit 1 || exit 0 + if [[ ! -z "$badfiletypes" ]]; then \ + echo "Bad types found\n$badfiletypes"; \ + else \ + echo "All files passed file type check" \ + if [[ ! -z "$badfiletypes" ]]; then \ + exit 1 \ + else \ + exit 0 \ - name: Check Image Filenames run: | badfilenames=$(find ${{ github.workspace }} -iregex '.\/.*[<>&:`"\|\?\\\/\*].*' -type f | awk '{print $1}') \ - [[ ! -z "$badfilenames" ]] && echo "Bad chars found\n$badfilenames" || echo "All files passed file names check" \ - [[ ! -z "$badfilenames" ]] && exit 1 || exit 0 + if [[ ! -z "$badfilenames" ]]; then \ + echo "Bad chars found\n$badfilenames"; \ + else \ + echo "All files passed file names check" \ + if [[ ! -z "$badfilenames" ]]; then \ + exit 1 \ + else \ + exit 0 \ - name: Check Image Sizes run: | badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') \ - [[ ! -z "$badfilesizes" ]] && echo "Bad files found\n$badfilesizes" || echo "All files passed size check" \ - [[ ! -z "$badfilesizes" ]] && exit 1 || exit 0 + if [[ ! -z "$badfilesizes" ]]; then \ + echo "Bad files found\n$badfilesizes"; \ + else \ + echo "All files passed file size check" \ + if [[ ! -z "$badfilesizes" ]]; then \ + exit 1 \ + else \ + exit 0 \ From 52287aaa80f999d68a1f43f04a612f98e981b753 Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 11:33:44 -0700 Subject: [PATCH 05/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 93105332..3c700249 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -12,33 +12,15 @@ jobs: - name: Check Image Types run: | badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f | awk '{print $1}') \ - if [[ ! -z "$badfiletypes" ]]; then \ - echo "Bad types found\n$badfiletypes"; \ - else \ - echo "All files passed file type check" \ - if [[ ! -z "$badfiletypes" ]]; then \ - exit 1 \ - else \ - exit 0 \ + if [ ! -z "$badfiletypes" ]; then echo "Bad types found\n$badfiletypes"; else echo "All files passed file type check";fi \ + if [[ ! -z "$badfiletypes" ]]; then exit 1; else exit 0;fi - name: Check Image Filenames run: | badfilenames=$(find ${{ github.workspace }} -iregex '.\/.*[<>&:`"\|\?\\\/\*].*' -type f | awk '{print $1}') \ - if [[ ! -z "$badfilenames" ]]; then \ - echo "Bad chars found\n$badfilenames"; \ - else \ - echo "All files passed file names check" \ - if [[ ! -z "$badfilenames" ]]; then \ - exit 1 \ - else \ - exit 0 \ + if [ ! -z "$badfilenames" ]; then echo "Bad chars found\n$badfilenames"; else echo "All files passed file names check";fi \ + if [[ ! -z "$badfilenames" ]]; then exit 1; else exit 0;fi - name: Check Image Sizes run: | badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') \ - if [[ ! -z "$badfilesizes" ]]; then \ - echo "Bad files found\n$badfilesizes"; \ - else \ - echo "All files passed file size check" \ - if [[ ! -z "$badfilesizes" ]]; then \ - exit 1 \ - else \ - exit 0 \ + if [ ! -z "$badfilesizes" ]; then echo "Bad file sizes found\n$badfilesizes"; else echo "All files passed file size check";fi \ + if [[ ! -z "$badfilesizes" ]]; then exit 1; else exit 0;fi From 2aaf89497498f5bc0dbf94e000139bfd6d91ddaf Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 11:40:59 -0700 Subject: [PATCH 06/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 40 +++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 3c700249..8d78c663 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -11,16 +11,40 @@ jobs: - uses: actions/checkout@v4 - name: Check Image Types run: | - badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f | awk '{print $1}') \ - if [ ! -z "$badfiletypes" ]; then echo "Bad types found\n$badfiletypes"; else echo "All files passed file type check";fi \ - if [[ ! -z "$badfiletypes" ]]; then exit 1; else exit 0;fi + badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f | awk '{print $1}') + if [ ! -z "$badfiletypes" ]; then + echo "Bad types found\n$badfiletypes" + else + echo "All files passed file type check" + fi + if [[ ! -z "$badfiletypes" ]]; then + exit 1 + else + exit 0 + fi - name: Check Image Filenames run: | - badfilenames=$(find ${{ github.workspace }} -iregex '.\/.*[<>&:`"\|\?\\\/\*].*' -type f | awk '{print $1}') \ - if [ ! -z "$badfilenames" ]; then echo "Bad chars found\n$badfilenames"; else echo "All files passed file names check";fi \ - if [[ ! -z "$badfilenames" ]]; then exit 1; else exit 0;fi + badfilenames=$(find ${{ github.workspace }} -iregex '.\/.*[<>&:`"\|\?\\\/\*].*' -type f | awk '{print $1}') + if [ ! -z "$badfilenames" ]; then + echo "Bad chars found\n$badfiletypes" + else + echo "All files passed file name check" + fi + if [[ ! -z "$badfilenames" ]]; then + exit 1 + else + exit 0 + fi - name: Check Image Sizes run: | badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') \ - if [ ! -z "$badfilesizes" ]; then echo "Bad file sizes found\n$badfilesizes"; else echo "All files passed file size check";fi \ - if [[ ! -z "$badfilesizes" ]]; then exit 1; else exit 0;fi + if [ ! -z "$badfilesizes" ]; then + echo "Bad file sizes found\n$badfilesizes" + else + echo "All files passed file size check" + fi + if [[ ! -z "$badfilesizes" ]]; then + exit 1 + else + exit 0 + fi From 8cad85ecb58213a115e8bf5795b4d15e681e33b0 Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 12:01:27 -0700 Subject: [PATCH 07/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 8d78c663..9bce71d9 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -10,8 +10,9 @@ jobs: steps: - uses: actions/checkout@v4 - name: Check Image Types + if: always() run: | - badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f | awk '{print $1}') + badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f -not -path '*/.*' | awk '{print $1}') if [ ! -z "$badfiletypes" ]; then echo "Bad types found\n$badfiletypes" else @@ -23,8 +24,9 @@ jobs: exit 0 fi - name: Check Image Filenames + if: always() run: | - badfilenames=$(find ${{ github.workspace }} -iregex '.\/.*[<>&:`"\|\?\\\/\*].*' -type f | awk '{print $1}') + badfilenames=$(find ${{ github.workspace }} -iregex '.\/.*[<>&:`"\|\?\\\/\*].*' -type f -not -path '*/.*' | awk '{print $1}') if [ ! -z "$badfilenames" ]; then echo "Bad chars found\n$badfiletypes" else @@ -36,8 +38,9 @@ jobs: exit 0 fi - name: Check Image Sizes + if: always() run: | - badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') \ + badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -not -path '*/.*' -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') \ if [ ! -z "$badfilesizes" ]; then echo "Bad file sizes found\n$badfilesizes" else From 2b9a47debdd9af7e396ff64d32495e7fe016dde0 Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 12:07:06 -0700 Subject: [PATCH 08/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 9bce71d9..11b40090 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -26,7 +26,7 @@ jobs: - name: Check Image Filenames if: always() run: | - badfilenames=$(find ${{ github.workspace }} -iregex '.\/.*[<>&:`"\|\?\\\/\*].*' -type f -not -path '*/.*' | awk '{print $1}') + badfilenames=$(find ${{ github.workspace }} -iregex '.*[<>&:`"\|\?\\\/\*].*' -type f -not -path '*/.*' | awk '{print $1}') if [ ! -z "$badfilenames" ]; then echo "Bad chars found\n$badfiletypes" else @@ -40,7 +40,7 @@ jobs: - name: Check Image Sizes if: always() run: | - badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -not -path '*/.*' -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') \ + badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -not -path '*/.*' -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') if [ ! -z "$badfilesizes" ]; then echo "Bad file sizes found\n$badfilesizes" else From 2c37baef980503d54cc0967138acf7a4fc48e305 Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 12:11:23 -0700 Subject: [PATCH 09/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 11b40090..c6f5155c 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -14,7 +14,8 @@ jobs: run: | badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f -not -path '*/.*' | awk '{print $1}') if [ ! -z "$badfiletypes" ]; then - echo "Bad types found\n$badfiletypes" + echo "Bad types found" + echo $badfiletypes else echo "All files passed file type check" fi @@ -28,7 +29,8 @@ jobs: run: | badfilenames=$(find ${{ github.workspace }} -iregex '.*[<>&:`"\|\?\\\/\*].*' -type f -not -path '*/.*' | awk '{print $1}') if [ ! -z "$badfilenames" ]; then - echo "Bad chars found\n$badfiletypes" + echo "Bad chars found" + echo $badfilenames else echo "All files passed file name check" fi @@ -42,7 +44,8 @@ jobs: run: | badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -not -path '*/.*' -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') if [ ! -z "$badfilesizes" ]; then - echo "Bad file sizes found\n$badfilesizes" + echo "Bad file sizes found" + echo $badfilesizes else echo "All files passed file size check" fi From ce6856371ff032267b654cfe2615beece6cff64a Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 13:47:51 -0700 Subject: [PATCH 10/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index c6f5155c..40017c2e 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -12,7 +12,7 @@ jobs: - name: Check Image Types if: always() run: | - badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f -not -path '*/.*' | awk '{print $1}') + badfiletypes=$(find ${{ github.workspace }} ! -iname "*.png" -type f -not -path '*/.*') if [ ! -z "$badfiletypes" ]; then echo "Bad types found" echo $badfiletypes @@ -27,7 +27,7 @@ jobs: - name: Check Image Filenames if: always() run: | - badfilenames=$(find ${{ github.workspace }} -iregex '.*[<>&:`"\|\?\\\/\*].*' -type f -not -path '*/.*' | awk '{print $1}') + badfilenames=$(find ${{ github.workspace }} -name '*[<>`?|"&*\\\/]*' -type f -not -path '*/.*') if [ ! -z "$badfilenames" ]; then echo "Bad chars found" echo $badfilenames @@ -42,15 +42,15 @@ jobs: - name: Check Image Sizes if: always() run: | - badfilesizes=$(find ${{ github.workspace }} -iname "*.png" -type f -not -path '*/.*' -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>512 {print $3}') - if [ ! -z "$badfilesizes" ]; then - echo "Bad file sizes found" - echo $badfilesizes - else - echo "All files passed file size check" - fi - if [[ ! -z "$badfilesizes" ]]; then - exit 1 - else - exit 0 - fi + pass=0 + for f in $(find ${{ github.workspace }} -iname "*.png" -type f -not -path '*/.*') + do + if [ -f "$f" ]; then + w=$(identify -format '%w' "$f") + if [ w>512 ]; then + echo "File size too wide ($w pixels): $f" + pass=1 + fi + fi + done + exit $pass From e176154b4100625a29e710ed5cbd5ef8c97ce4dd Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 14:14:32 -0700 Subject: [PATCH 11/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 40017c2e..9c2b3ded 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -43,12 +43,12 @@ jobs: if: always() run: | pass=0 - for f in $(find ${{ github.workspace }} -iname "*.png" -type f -not -path '*/.*') + find . -iname "*.png" -type f -not -path '*/.*' -print0 | while read -d $'\0' file do - if [ -f "$f" ]; then - w=$(identify -format '%w' "$f") - if [ w>512 ]; then - echo "File size too wide ($w pixels): $f" + if [ -f "$file" ]; then + w=$(identify -format '%w' "$file") + if [ $w -gt 512 ]; then + echo "File size too wide ($w pixels): $file" pass=1 fi fi From b9a3ef545aeaa6ad21b21c3bf5fe826cb740cb79 Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 14:19:33 -0700 Subject: [PATCH 12/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 9c2b3ded..089a0ed6 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -43,7 +43,7 @@ jobs: if: always() run: | pass=0 - find . -iname "*.png" -type f -not -path '*/.*' -print0 | while read -d $'\0' file + find ${{ github.workspace }} -iname "*.png" -type f -not -path '*/.*' -print0 | while read -d $'\0' file do if [ -f "$file" ]; then w=$(identify -format '%w' "$file") From f617af3428f7a00398c05ffaaad2c92f9a5e752b Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Fri, 11 Oct 2024 14:39:38 -0700 Subject: [PATCH 13/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 089a0ed6..f9fed833 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -1,5 +1,7 @@ name: Check Images on: + workflow_dispatch: + pull_request: types: [opened] @@ -49,7 +51,7 @@ jobs: w=$(identify -format '%w' "$file") if [ $w -gt 512 ]; then echo "File size too wide ($w pixels): $file" - pass=1 + pass+=1 fi fi done From 11d345d4f5cb98f2f660b28979ffa45ad69e25a7 Mon Sep 17 00:00:00 2001 From: Zach Morris Date: Sun, 13 Oct 2024 08:59:00 -0700 Subject: [PATCH 14/14] Update pr_check.yml --- .github/workflows/pr_check.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index f9fed833..88c15c49 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -45,7 +45,7 @@ jobs: if: always() run: | pass=0 - find ${{ github.workspace }} -iname "*.png" -type f -not -path '*/.*' -print0 | while read -d $'\0' file + while read -d $'\0' file do if [ -f "$file" ]; then w=$(identify -format '%w' "$file") @@ -54,5 +54,8 @@ jobs: pass+=1 fi fi - done + done < <(find . -iname "*.png" -type f -not -path '*/.*' -print0) + if [ "$pass" != "0" ]; then + echo "One or more files failed size check" + fi exit $pass