From 3cf8e1e4d8e21805d94de359f60be8d65fbcb0d6 Mon Sep 17 00:00:00 2001 From: Rajendra Reddy Date: Mon, 13 Apr 2026 03:46:05 +0000 Subject: [PATCH] Update .gitea/workflows/compressimage.yml --- .gitea/workflows/compressimage.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/compressimage.yml b/.gitea/workflows/compressimage.yml index a76f743..7d9aaa7 100644 --- a/.gitea/workflows/compressimage.yml +++ b/.gitea/workflows/compressimage.yml @@ -1,6 +1,7 @@ name: Enforce Image Standards on: + pull_request: branches: - main - beta @@ -8,7 +9,6 @@ on: - client - staging - production - pull_request: paths: - '**.jpg' - '**.jpeg' @@ -28,25 +28,21 @@ jobs: sudo apt-get update sudo apt-get install -y imagemagick jpegoptim pngquant - # Resize images larger than 1920px (keeps aspect ratio) - name: Resize Oversized Images run: | find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) \ -exec mogrify -resize 1920x1920\> {} \; - # Optimize JPEG safely - name: Optimize JPEG run: | find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) \ -exec jpegoptim --strip-all --max=85 {} \; - # Optimize PNG safely - name: Optimize PNG run: | find . -type f -iname "*.png" \ -exec pngquant --force --ext .png --quality=75-90 {} \; - # Commit only if changes exist - name: Commit Optimized Images run: | git config --global user.name "gitea-actions" @@ -55,5 +51,7 @@ jobs: if [ -n "$(git status --porcelain)" ]; then git add . git commit -m "Auto resize and optimize images" - git push origin HEAD:${{ github.head_ref }} - fi + git push origin HEAD:${{ gitea.head_ref }} + else + echo "No changes to commit" + fi \ No newline at end of file