Skip to content

Commit db0058c

Browse files
authored
Merge branch 'ArmDeveloperEcosystem:main' into content_review
2 parents b755e12 + 6345817 commit db0058c

File tree

962 files changed

+592
-367
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

962 files changed

+592
-367
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Resize Images
2+
# A weekly run to resize images that changed in the last week
3+
4+
on:
5+
schedule:
6+
- cron: "0 9 * * 1" # every Monday at 09:00 UTC
7+
workflow_dispatch:
8+
9+
jobs:
10+
resize-images:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # Fetch full history to compare with last week
17+
18+
- name: Get changed image files from last week
19+
id: changed-files
20+
run: |
21+
# Find all image files that changed since last Monday
22+
CHANGED_IMAGES=$(git log --since="7 days ago" --name-only --pretty="" \
23+
-- '*.jpg' '*.jpeg' '*.png' '*.JPG' '*.JPEG' '*.PNG' | sort -u | tr '\n' ' ')
24+
25+
echo "changed_images=$CHANGED_IMAGES" >> $GITHUB_OUTPUT
26+
echo "Changed images: $CHANGED_IMAGES"
27+
28+
# Set a flag if any images were changed
29+
if [ -n "$CHANGED_IMAGES" ]; then
30+
echo "has_changes=true" >> $GITHUB_OUTPUT
31+
else
32+
echo "has_changes=false" >> $GITHUB_OUTPUT
33+
fi
34+
35+
- name: Install ImageMagick
36+
run: sudo apt-get update && sudo apt-get install -y imagemagick
37+
38+
- name: Run tools/resize_images.sh on changed files
39+
if: steps.changed-files.outputs.has_changes == 'true'
40+
run: |
41+
# Pass the changed image files to the resize script
42+
bash tools/resize_images.sh ${{ steps.changed-files.outputs.changed_images }}
43+
- name: Create Pull Request
44+
uses: peter-evans/create-pull-request@v6
45+
if: steps.changed-files.outputs.has_changes == 'true' && success()
46+
with:
47+
commit-message: Resize images changed in the last week
48+
title: Resize images changed in the last week
49+
body: |
50+
Resize images that were modified in the last week (Monday to Monday)
51+
52+
Changed files: ${{ steps.changed-files.outputs.changed_images }}
53+
54+
Triggered by workflow run ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
55+
Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request
56+
branch: resize-images
57+
base: main
-188 KB
Binary file not shown.
105 KB
-209 KB
Binary file not shown.
136 KB
-369 KB
Binary file not shown.
83.8 KB
Binary file not shown.
210 KB
-1.42 MB
Binary file not shown.

0 commit comments

Comments
 (0)