forked from ubiquity/ubiquibot
-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (25 loc) · 800 Bytes
/
Copy pathshort-files.yml
File metadata and controls
28 lines (25 loc) · 800 Bytes
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
name: Check File Length
on:
push:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check file length
run: |
IGNORE=("src/adapters/supabase/types/database.ts" "src/generatedFile2.ts") # Add more files to ignore as needed
find src -name "*.ts" -type f -exec bash -c '
for ignore in "${IGNORE[@]}"; do
if [[ "$1" == "$ignore" ]]; then
echo "Ignoring $ignore"
exit 0
fi
done
if [[ $(wc -l < "$1") -gt 512 ]]; then
echo "File $1 line length is greater than 512. This should be broken up into smaller files."
exit 1
fi
' bash {} \;