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... #304

Open
wants to merge 1 commit into
base: sweep/sweep_gha_fix_the_github_actions_run_fai_220d8
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions scripts/githooks/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ RED="\e[31m"
ENDCOLOR="\e[0m"

printMessage() {
printf "${YELLOW}openim : $1${ENDCOLOR}\n"
printf "${YELLOW}openim : Error - $1${ENDCOLOR}\n"
}

printSuccess() {
printf "${GREEN}openim : $1${ENDCOLOR}\n"
printf "${GREEN}openim : Success - $1${ENDCOLOR}\n"
}

printError() {
printf "${RED}openim : $1${ENDCOLOR}\n"
printf "${RED}openim : Failure - $1${ENDCOLOR}\n"
}

printMessage "Running local openim pre-commit hook."
Expand All @@ -73,9 +73,9 @@ function file_too_large(){
filesize=$(( $1 \/ 2**20 ))\ncat <<HEREDOC

File $filename is $filesize MB, which is larger than github's maximum
file size (2 MB). We will not be able to push this file to GitHub.
file size limit (${limitInMB} MB). This file cannot be pushed to GitHub due to size constraints.
The maximum file size allowed is 2MB.
Commit aborted
Commit aborted - File size limit exceeded

HEREDOC

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