mirror of
https://github.com/kirodotdev/Kiro.git
synced 2026-11-25 00:47:06 +08:00
- Add GitHub Actions workflows for issue triage, duplicate detection, and stale issue management - Add AWS Bedrock integration for AI-powered issue classification and duplicate detection - Add TypeScript scripts for issue automation including labeling, triaging, and closing workflows - Add comprehensive documentation for setup, implementation, and testing procedures - Add security fixes for prompt injection vulnerabilities in AI model interactions - Add local testing framework with Jest configuration and test utilities - Add rate limiting and retry utilities for GitHub API and AWS Bedrock calls - Add environment configuration examples and ESLint setup for TypeScript scripts - Add detailed testing results and completion status documentation - Implement automated duplicate detection using semantic similarity analysis - Implement stale issue closing with configurable timelines and grace periods - Implement issue classification and auto-labeling based on content analysis
106 lines
3.2 KiB
Bash
Executable File
106 lines
3.2 KiB
Bash
Executable File
#!/bin/bash
|
||
|
||
# Local Testing Script for GitHub Issue Automation
|
||
# This script helps you test the automation locally
|
||
|
||
set -e
|
||
|
||
echo "╔════════════════════════════════════════════════════════════╗"
|
||
echo "║ GitHub Issue Automation - Local Testing Setup ║"
|
||
echo "╚════════════════════════════════════════════════════════════╝"
|
||
echo ""
|
||
|
||
# Check if we're in the right directory
|
||
if [ ! -f "package.json" ]; then
|
||
echo "❌ Error: Please run this script from .github/scripts directory"
|
||
echo " cd .github/scripts && ./test.sh"
|
||
exit 1
|
||
fi
|
||
|
||
# Check Node.js
|
||
if ! command -v node &> /dev/null; then
|
||
echo "❌ Node.js is not installed"
|
||
echo " Please install Node.js 20+ from https://nodejs.org"
|
||
exit 1
|
||
fi
|
||
|
||
NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
|
||
if [ "$NODE_VERSION" -lt 20 ]; then
|
||
echo "⚠️ Warning: Node.js version is $NODE_VERSION, but 20+ is recommended"
|
||
fi
|
||
|
||
echo "✅ Node.js $(node -v) detected"
|
||
echo ""
|
||
|
||
# Check environment variables
|
||
echo "📋 Checking environment variables..."
|
||
echo ""
|
||
|
||
if [ -z "$AWS_ACCESS_KEY_ID" ]; then
|
||
echo "❌ AWS_ACCESS_KEY_ID is not set"
|
||
echo ""
|
||
echo "Please set your AWS credentials:"
|
||
echo " export AWS_ACCESS_KEY_ID='your-access-key'"
|
||
echo " export AWS_SECRET_ACCESS_KEY='your-secret-key'"
|
||
echo " export AWS_REGION='us-east-1' # optional"
|
||
echo ""
|
||
exit 1
|
||
fi
|
||
|
||
if [ -z "$AWS_SECRET_ACCESS_KEY" ]; then
|
||
echo "❌ AWS_SECRET_ACCESS_KEY is not set"
|
||
exit 1
|
||
fi
|
||
|
||
echo "✅ AWS credentials are set"
|
||
|
||
if [ -z "$AWS_REGION" ]; then
|
||
echo "ℹ️ AWS_REGION not set, will use default: us-east-1"
|
||
export AWS_REGION="us-east-1"
|
||
else
|
||
echo "✅ AWS_REGION: $AWS_REGION"
|
||
fi
|
||
|
||
if [ -z "$GITHUB_TOKEN" ]; then
|
||
echo "⚠️ GITHUB_TOKEN not set (optional for duplicate detection)"
|
||
else
|
||
echo "✅ GITHUB_TOKEN is set"
|
||
fi
|
||
|
||
echo ""
|
||
|
||
# Install dependencies
|
||
echo "📦 Installing dependencies..."
|
||
if [ ! -d "node_modules" ]; then
|
||
npm install
|
||
else
|
||
echo " Dependencies already installed"
|
||
fi
|
||
echo ""
|
||
|
||
# Build TypeScript
|
||
echo "🔨 Building TypeScript..."
|
||
npm run build
|
||
echo ""
|
||
|
||
# Run tests
|
||
echo "🧪 Running tests..."
|
||
echo ""
|
||
node dist/test/test-local.js
|
||
|
||
echo ""
|
||
echo "╔════════════════════════════════════════════════════════════╗"
|
||
echo "║ Testing Complete! ║"
|
||
echo "╚════════════════════════════════════════════════════════════╝"
|
||
echo ""
|
||
echo "💡 Next steps:"
|
||
echo " 1. Review the test results above"
|
||
echo " 2. Check AWS costs in AWS Console"
|
||
echo " 3. If tests pass, deploy to GitHub Actions"
|
||
echo ""
|
||
echo "📚 Documentation:"
|
||
echo " - Local testing: .github/LOCAL_TESTING.md"
|
||
echo " - Full setup: .github/AUTOMATION_SETUP.md"
|
||
echo " - Quick start: .github/QUICKSTART.md"
|
||
echo ""
|