diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..c534e9ac --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,12 @@ +name: Release Drafter Configuration +on: + push: + branches: + - main + - master + pull_request: + types: + - opened + - reopened + - synchronize + - edited diff --git a/scripts/githooks/pre-commit.sh b/scripts/githooks/pre-commit.sh index 4f1aab1b..b9d19ff0 100644 --- a/scripts/githooks/pre-commit.sh +++ b/scripts/githooks/pre-commit.sh @@ -53,7 +53,7 @@ printMessage "Running local openim pre-commit hook." # flutter format . # https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md -# TODO! GIT_FILE_SIZE_LIMIT=50000000 git commit -m "test: this commit is allowed file sizes up to 50MB" +# TODO! GIT_FILE_SIZE_LIMIT=2000000 git commit -m "test: this commit is allowed file sizes up to 50MB" # Maximum file size limit in bytes limit=${GIT_FILE_SIZE_LIMIT:-50000000} # Default 50MB limitInMB=$(( $limit / 1000000 )) @@ -87,7 +87,7 @@ IFS=' shouldFail=false for file in $( git diff-index --cached --name-only $against ); do file_size=$(([ ! -f $file ] && echo 0) || (ls -la $file | awk '{ print $5 }')) - if [ "$file_size" -gt "$limit" ]; then + if [ "$file_size" -gt "$limit" ] && { grep -q ".github/release-drafter.yml" $file ;}; then printError "File $file is $(( $file_size / 10**6 )) MB, which is larger than our configured limit of $limitInMB MB" shouldFail=true fi