Skip to content

deleted photo

deleted photo #11

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 Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: |
npm install sharp exiftool-vendored fs-extra xml2js
- name: Process Images
run: |
for file in $(git diff --name-only --diff-filter=A HEAD^ HEAD | grep -E '^photos/.*\.(jpg|jpeg|png)$'); do
node process_image.js "$file"
done
- name: List changed files
run: git status
- name: Commit changes
run: |
shopt -s nullglob # Enable nullglob to prevent errors when no files match
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add --all
git commit -m "Generated images and metadata files" || echo "No changes to commit"
git push || echo "Nothing to push"