MaxHuber888
commited on
Update main.yml
Browse files- .github/workflows/main.yml +12 -6
.github/workflows/main.yml
CHANGED
@@ -6,18 +6,24 @@ on:
|
|
6 |
branches: [main]
|
7 |
workflow_dispatch:
|
8 |
|
9 |
-
permissions:
|
10 |
-
contents: read
|
11 |
-
|
12 |
jobs:
|
13 |
check-file-size:
|
14 |
runs-on: ubuntu-latest
|
15 |
steps:
|
16 |
- uses: actions/checkout@v3
|
17 |
- name: Check large files
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
sync-to-hub:
|
22 |
needs: check-file-size
|
23 |
runs-on: ubuntu-latest
|
|
|
6 |
branches: [main]
|
7 |
workflow_dispatch:
|
8 |
|
|
|
|
|
|
|
9 |
jobs:
|
10 |
check-file-size:
|
11 |
runs-on: ubuntu-latest
|
12 |
steps:
|
13 |
- uses: actions/checkout@v3
|
14 |
- name: Check large files
|
15 |
+
run: |
|
16 |
+
#!/bin/bash
|
17 |
+
max_size=10485760 # 10MB in bytes
|
18 |
+
large_files=$(find . -type f -size +${max_size}c)
|
19 |
+
if [ -n "$large_files" ]; then
|
20 |
+
echo "Warning: The following files are larger than 10MB:"
|
21 |
+
echo "$large_files"
|
22 |
+
exit 1
|
23 |
+
else
|
24 |
+
echo "No files larger than 10MB found."
|
25 |
+
fi
|
26 |
+
|
27 |
sync-to-hub:
|
28 |
needs: check-file-size
|
29 |
runs-on: ubuntu-latest
|