-
-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (29 loc) · 2.94 KB
/
enforce-webp-only.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Enforce WEBP Image Format
on:
pull_request:
paths:
- '**.png'
- '**.jpg'
- '**.jpeg'
- '**.gif'
- '**.bmp'
- '**.tiff'
- '**.ico'
jobs:
check-images:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check for non-WEBP images
run: |
files=$(git diff --name-only ${{ github.event.before }} ${{
github.sha }} -- '*.png' '*.jpg' '*.jpeg' '*.gif' '*.bmp' '*.tiff' '*.ico')
if [ -n "$files" ]; then
echo "The following non-WEBP image files have been found in the
pull request:"
echo "$files"
exit 1
else
echo "No non-WEBP images found. Proceeding..."
fi