Skip to content

Workflow file for this run

name: Format images
on:
pull_request:
paths:
- 'logoIcons/**/*.jpg'
- 'logoIcons/**/*.jpeg'
- 'logoIcons/**/*.png'
- 'logoIcons/**/*.webp'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: mfinelli/setup-imagemagick@v5
- name: Get logo icons changed
id: changed-logo-icons
uses: tj-actions/changed-files@v39
with:
separator: ","
files: |
./logoIcons
- name: Resize to 200x200
run: |
IFS=$','
vals="${{ steps.changed-logo-icons.outputs.all_changed_and_modified_files }}"
for file in $vals; do
magick mogrify -resize 200x200 "$file";
done
- name: Convert to png
run: |
IFS=$','
vals="${{ steps.changed-logo-icons.outputs.all_changed_and_modified_files }}"
for file in $vals; do
magick mogrify -format png "$file";
done
- name: Remove any left over none png images from mogrify command
run: cd ./logoIcons && find . -type f ! -name '*.png' -delete
- name: Compress logo icons
uses: calibreapp/image-actions@main
with:
compressOnly: true
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Commit changes
uses: endbug/add-and-commit@v4
with:
add: './logoIcons'
author_name: "github-actions[bot]"
author_email: "github-actions@users.noreply.github.com"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}