🔧 chore: fix skill naming and gitea actions compatibility (related to #2)
Some checks failed
CI/CD Pipeline / CI Pipeline (push) Failing after 7m12s
Some checks failed
CI/CD Pipeline / CI Pipeline (push) Failing after 7m12s
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Issue Reference Suggestion Script
|
||||
# Suggests relevant Gitea issues to reference in commit messages
|
||||
# This script is NON-BLOCKING and will never prevent commits
|
||||
|
||||
set -e
|
||||
=======
|
||||
|
||||
# Configuration
|
||||
GITEA_CLIENT=".vibe/skills/gitea-client/scripts/gitea-client.sh"
|
||||
|
||||
# Check if we have Gitea client available
|
||||
if [ ! -f "$GITEA_CLIENT" ]; then
|
||||
echo "Gitea client not found - issue reference suggestions disabled"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if we can access Gitea API
|
||||
if [ -z "${GITEA_API_TOKEN_FILE:-}" ] && [ -z "${GITEA_API_TOKEN:-}" ]; then
|
||||
echo "Gitea API token not configured - issue reference suggestions disabled"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "🔍 Checking for relevant issues..."
|
||||
|
||||
# Get list of open issues
|
||||
ISSUES_JSON=$($GITEA_CLIENT list-issues arcodange DanceLessonsCoach open 2>/dev/null || echo "[]")
|
||||
|
||||
# Check if we got valid JSON
|
||||
if [ "$ISSUES_JSON" = "[]" ] || [ -z "$ISSUES_JSON" ]; then
|
||||
echo "✅ No open issues found (you can commit freely)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Extract issue numbers and titles
|
||||
ISSUE_COUNT=$(echo "$ISSUES_JSON" | jq '. | length')
|
||||
|
||||
if [ "$ISSUE_COUNT" -eq 0 ]; then
|
||||
echo "✅ No open issues found"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "📋 Found $ISSUE_COUNT open issue(s):"
|
||||
echo ""
|
||||
|
||||
# Display issues with numbers and titles
|
||||
for ((i=0; i<ISSUE_COUNT; i++)); do
|
||||
ISSUE_NUMBER=$(echo "$ISSUES_JSON" | jq -r ".[$i].number")
|
||||
ISSUE_TITLE=$(echo "$ISSUES_JSON" | jq -r ".[$i].title")
|
||||
ISSUE_URL=$(echo "$ISSUES_JSON" | jq -r ".[$i].html_url")
|
||||
|
||||
echo " #$ISSUE_NUMBER: $ISSUE_TITLE"
|
||||
echo " $ISSUE_URL"
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "💡 Suggested commit message formats:"
|
||||
echo ""
|
||||
echo " - closes #<number> (when issue is fully resolved)"
|
||||
echo " - fixes #<number> (when fixing a bug)"
|
||||
echo " - resolves #<number> (when resolving an issue)"
|
||||
echo " - related to #<number> (when work is related)"
|
||||
echo " - see #<number> (when referencing for context)"
|
||||
echo ""
|
||||
echo "Example: ✨ feat: implement workflow (closes #2)"
|
||||
echo ""
|
||||
|
||||
exit 0
|
||||
67
.vibe/skills/commit-message/scripts/validate-commit.sh
Executable file
67
.vibe/skills/commit-message/scripts/validate-commit.sh
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Commit message validation script
|
||||
# Validates that commit messages follow the Gitmoji convention
|
||||
|
||||
set -e
|
||||
|
||||
# Check if commit message file is provided
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: $0 <commit-message-file>"
|
||||
echo "Example: $0 .git/COMMIT_EDITMSG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
COMMIT_MSG_FILE="$1"
|
||||
|
||||
# Check if file exists
|
||||
if [ ! -f "$COMMIT_MSG_FILE" ]; then
|
||||
echo "Error: File $COMMIT_MSG_FILE not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Read first line of commit message
|
||||
FIRST_LINE=$(head -n 1 "$COMMIT_MSG_FILE")
|
||||
|
||||
# Gitmoji pattern - check for any gitmoji at the start
|
||||
GITMOJI_PATTERN='^[[:space:]]*[🎨✨🐛📝🔧♻️🚀🔒📦🔥🐧🍎🪟🤖🧪📈🌐⚡]'
|
||||
|
||||
# Simpler validation - check for emoji followed by type:description
|
||||
# This avoids complex regex issues with emoji characters
|
||||
|
||||
echo "Validating commit message: $FIRST_LINE"
|
||||
|
||||
# Check for gitmoji (any emoji character at start)
|
||||
if ! echo "$FIRST_LINE" | grep -q '^[[:space:]]*[^[:alnum:]]'; then
|
||||
echo "❌ Error: Missing gitmoji at start of commit message"
|
||||
echo " Expected: ✨ 🐛 📝 ♻️ 🧪 🔧 etc."
|
||||
echo " Got: $FIRST_LINE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for type:description format (emoji followed by word and colon)
|
||||
if ! echo "$FIRST_LINE" | grep -qE '^[[:space:]]*[^[:alnum:]][[:space:]]+[a-z_]+:'; then
|
||||
echo "❌ Error: Invalid commit message format"
|
||||
echo " Expected: <gitmoji> <type>: <description>"
|
||||
echo " Example: ✨ feat: add new feature"
|
||||
echo " Got: $FIRST_LINE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check first line length (should be < 50 chars)
|
||||
FIRST_LINE_LENGTH=${#FIRST_LINE}
|
||||
if [ $FIRST_LINE_LENGTH -gt 50 ]; then
|
||||
echo "⚠️ Warning: First line is $FIRST_LINE_LENGTH characters (recommended max: 50)"
|
||||
echo " Consider: '$FIRST_LINE'"
|
||||
fi
|
||||
|
||||
# Extract gitmoji and type (simplified to avoid emoji regex issues)
|
||||
GITMOJI=$(echo "$FIRST_LINE" | grep -o "^[^[:alnum:]]")
|
||||
TYPE=$(echo "$FIRST_LINE" | sed -E 's/^[^[:alnum:]][[:space:]]*([a-z_]+):.*/\1/')
|
||||
|
||||
echo "✅ Valid commit message format"
|
||||
echo " Gitmoji: $GITMOJI"
|
||||
echo " Type: $TYPE"
|
||||
echo " Description: $(echo "$FIRST_LINE" | sed 's/^[^[:alnum:]][[:space:]]*[a-z_]+: //')"
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user