mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 16:43:12 +02:00
feat: add github actrion blocking user from pushing files bigger than 2GB
This commit is contained in:
parent
f26477ac34
commit
0c85def8ea
21
.github/workflows/check-large-files.yml
vendored
Normal file
21
.github/workflows/check-large-files.yml
vendored
Normal 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
5
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"github.vscode-github-actions"
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user