Skip to content

Commit

Permalink
Merge pull request #145 from kubecub/sweep/gh-actions-failure_2
Browse files Browse the repository at this point in the history
Fix GitHub Actions Failure Due to Missing go-gitlint Tool
  • Loading branch information
cubxxw authored Dec 30, 2023
2 parents 41d6272 + e521c74 commit 6ff25a0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/githooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ test "" = "$(grep '^Signed-off-by: ' "$1" |
# TODO: go-gitlint dir set
GITLINT_DIR="./_output/tools/go-gitlint"

if ! command -v $GITLINT_DIR &>/dev/null; then
echo "$GITLINT_DIR not found. Attempting to install it..."
# Add the commands to download and install the go-gitlint tool here
if [ $? -ne 0 ]; then
printError "Failed to install $GITLINT_DIR. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it manually."
exit 1
fi
fi

$GITLINT_DIR \
--msg-file=$1 \
--subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|test)(.*)?:\s?.*" \
Expand Down

0 comments on commit 6ff25a0

Please sign in to comment.