-
Notifications
You must be signed in to change notification settings - Fork 1.1k
43 lines (37 loc) · 1.07 KB
/
gif_check.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
33
34
35
36
37
38
39
40
41
42
43
name: "Check for GIF files"
on:
pull_request:
paths:
- 'static/images/**/*'
# Stop the current running job if a new push is made to the PR
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
look-for-gifs:
permissions:
contents: read
if: github.ref != 'refs/heads/guacbot/translation-pipeline'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Find changed files
id: changed_files
uses: tj-actions/changed-files@v42
- name: Look for gifs
env:
branch: ${{ github.head_ref }}
ALL_CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }}
id: comment_body
run: |
for file in $ALL_CHANGED_FILES; do
echo "Checking file ${file}..."
if [[ "$file" =~ ^static/images/(.*).gif$ ]]; then
echo "The file $file is a gif. Please replace with an mp4"
exit 1
fi
done