Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sweep GHA Fix] The GitHub Actions run failed with... #305

Open
wants to merge 2 commits into
base: sweep/sweep_gha_fix_the_github_actions_run_fai_e59e8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scripts/githooks/go-gitlint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
# limitations under the License.

run_go_gitlint() {
local commit_msg_file="\$1"
local go_gitlint_target="go-gitlint"
local subject_regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|bot|test):\\\s?.*"
local subject_maxlen=150
local subject_minlen=10
local commit_msg_file="$1"
local go_gitlint_target="go-gitlint"
local subject_regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|bot|test)(.*)?:\s?.*"
Expand Down
4 changes: 2 additions & 2 deletions scripts/githooks/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ printMessage "Running local openim pre-commit hook."
# https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md
# 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
limit=${GIT_FILE_SIZE_LIMIT:-2000000} # Default 2MB
limitInMB=$(( $limit / 1000000 ))

function file_too_large(){
Expand Down Expand Up @@ -98,7 +98,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" ] && { grep -q ".github/release-drafter.yml" $file ;}; then
if [ "$file_size" -gt "$limit" ]; then
printError "File $file is $(( $file_size / 10**6 )) MB, which is larger than our configured limit of $limitInMB MB"
shouldFail=true
printError "File $file is $(( $file_size / 10**6 )) MB, which is larger than our configured limit of $limitInMB MB"
Expand Down
Loading