feat: add github actrion blocking user from pushing files bigger than 2GB

This commit is contained in:
Krzysztof Rudnicki 2024-11-28 18:23:17 +01:00
parent f26477ac34
commit 0c85def8ea
2 changed files with 26 additions and 0 deletions

21
.github/workflows/check-large-files.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Check for Large Files
on: push
jobs:
check-large-files:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Check File Sizes
run: |
max_size=$((2 * 1024 * 1024 * 1024))
for file in $(git ls-tree -r HEAD --name-only); do
size=$(stat --printf="%s" "$file")
if [ "$size" -gt "$max_size" ]; then
echo "Error: $file exceeds 2GB."
exit 1
fi
done

5
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"github.vscode-github-actions"
]
}