Update .gitea/workflows/compressimage.yml (#14)
All checks were successful
Klc-HR-Dashboard-Frontend-Build-Check / Build and Test PR (pull_request) Successful in 31s
Enforce Image Standards / optimize (pull_request) Successful in 25s
Klc-Learner-Frontend-Sonar / SonarQube Scan (pull_request) Successful in 58s

Reviewed-on: #14
This commit is contained in:
2026-04-14 12:56:56 +00:00
parent cc5c77e607
commit f3d2d80723

View File

@@ -23,11 +23,9 @@ jobs:
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
- name: Debug Event fetch-depth: 0
run: | ref: ${{ gitea.head_ref }} # IMPORTANT
echo "Base: ${{ gitea.base_ref }}"
echo "Head: ${{ gitea.head_ref }}"
- name: Install Image Tools - name: Install Image Tools
run: | run: |
@@ -48,3 +46,22 @@ jobs:
run: | run: |
find . -type f -iname "*.png" \ find . -type f -iname "*.png" \
-exec pngquant --force --ext .png --quality=75-90 {} \; -exec pngquant --force --ext .png --quality=75-90 {} \;
# Commit changes if any
- name: Commit changes
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@local"
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "chore: optimize images via CI"
else
echo "No changes to commit"
fi
# Push back to PR branch
- name: Push changes
if: success()
run: |
git push origin HEAD:${{ gitea.head_ref }}