Files
dance-lessons-coach/.vibe/skills/commit_message/scripts/suggest-issue-reference.sh
Gabriel Radureau 7c8c821f66
Some checks failed
Go CI/CD Pipeline / Build and Test (push) Successful in 4m26s
Docker Build and Publish / Version Bump (push) Successful in 10m6s
Go CI/CD Pipeline / Lint and Format (push) Successful in 10m33s
Go CI/CD Pipeline / Version Management (push) Successful in 25s
Main Branch CI/CD (Optimized) / Build and Test (push) Failing after 4m2s
Main Branch CI/CD (Optimized) / Lint and Format (push) Successful in 4m41s
Main Branch CI/CD (Optimized) / Version Management and Docker Build (push) Has been skipped
Docker Build and Publish / Build and Push Docker Image (push) Failing after 5m1s
feat: enhance commit message skill with issue reference suggestions (related to #2)
2026-04-06 16:06:42 +02:00

69 lines
1.9 KiB
Bash

#!/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