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

Fix GitHub Actions Failure Due to Missing go-gitlint Tool #130

Closed
wants to merge 2 commits into from
Closed
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
11 changes: 9 additions & 2 deletions scripts/githooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
# You may need to make the script executable by 'chmod +x .git/hooks/commit-msg'.

# commit-msg use go-gitlint tool, install go-gitlint via `go get github.com/llorllale/go-gitlint/cmd/go-gitlint`
# Check if go-gitlint exists
if ! command -v ./_output/tools/go-gitlint &>/dev/null; then
make tools
fi

# go-gitlint --msg-file="$1"

# An example hook script to check the commit log message.
Expand Down Expand Up @@ -61,8 +66,10 @@ $GITLINT_DIR \

if [ $? -ne 0 ]
then
if ! command -v $GITLINT_DIR &>/dev/null; then
printError "$GITLINT_DIR not found. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it."
printError "$GITLINT_DIR not found. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it."
fi
if ! command -v $GITLINT_DIR &>/dev/null; then

fi
printError "Please fix your commit message to match kubecub coding standards"
printError "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md"
Expand Down
4 changes: 4 additions & 0 deletions scripts/githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ printError() {

printMessage "Running local kubecub pre-commit hook."

# Check if go-gitlint exists
if ! command -v ./_output/tools/go-gitlint &>/dev/null; then
make tools
fi
# 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"
Expand Down
Loading