Skip to content

Glendale, Wisconsin

Glendale, Wisconsin #1

name: Process Image on Commit
on:
push:
paths:
- "photos/**" # Specify that all changes within the 'photos' folder and its subfolders trigger the action
jobs:
process_image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.14' # Specified Python version 3.14 because it is getting features when I wrote this
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pillow exifread
- name: Process Images
run: |
for file in $(git diff --name-only --diff-filter=A HEAD^ HEAD | grep -E '^photos/.*\.(jpg|jpeg|png)$'); do
python process_image.py "$file"
done
- name: Commit changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add .
git commit -m "Generated thumbnail and EXIF data"
git push