forked from claude-did-this/claude-hub
feat: Update organization name from intelligence-assist to claude-did-this (#162)
- Updated all GitHub URLs and organization references across the codebase - Updated documentation links to use claude-did-this.com - Removed self-hosted runner related files as they are no longer used - Updated test repository references - Preserved Docker Hub references as requested Note: .env files and .claude/settings.local.json were also updated but are gitignored 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
12
.github/dependabot.yml
vendored
12
.github/dependabot.yml
vendored
@@ -9,9 +9,9 @@ updates:
|
||||
prefix: "chore"
|
||||
include: "scope"
|
||||
reviewers:
|
||||
- "intelligence-assist"
|
||||
- "claude-did-this"
|
||||
assignees:
|
||||
- "intelligence-assist"
|
||||
- "claude-did-this"
|
||||
open-pull-requests-limit: 10
|
||||
|
||||
# Enable version updates for Docker
|
||||
@@ -23,9 +23,9 @@ updates:
|
||||
prefix: "chore"
|
||||
include: "scope"
|
||||
reviewers:
|
||||
- "intelligence-assist"
|
||||
- "claude-did-this"
|
||||
assignees:
|
||||
- "intelligence-assist"
|
||||
- "claude-did-this"
|
||||
|
||||
# Enable version updates for GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
@@ -36,6 +36,6 @@ updates:
|
||||
prefix: "chore"
|
||||
include: "scope"
|
||||
reviewers:
|
||||
- "intelligence-assist"
|
||||
- "claude-did-this"
|
||||
assignees:
|
||||
- "intelligence-assist"
|
||||
- "claude-did-this"
|
||||
@@ -81,8 +81,8 @@ The project uses Husky for Git pre-commit hooks to ensure code quality:
|
||||
|
||||
### End-to-End Testing
|
||||
Use the demo repository for testing auto-tagging and webhook functionality:
|
||||
- Demo repository: `https://github.com/intelligence-assist/demo-repository`
|
||||
- Test auto-tagging: `./cli/webhook-cli.js --repo "intelligence-assist/demo-repository" --command "Auto-tag this issue" --issue 1 --url "http://localhost:8082"`
|
||||
- Demo repository: `https://github.com/claude-did-this/demo-repository`
|
||||
- Test auto-tagging: `./cli/webhook-cli.js --repo "claude-did-this/demo-repository" --command "Auto-tag this issue" --issue 1 --url "http://localhost:8082"`
|
||||
- Test with specific issue content: Create a new issue in the demo repository to trigger auto-tagging webhook
|
||||
- Verify labels are applied based on issue content analysis
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Get Claude responding to your GitHub issues in minutes using Cloudflare Tunnel.
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://github.com/intelligence-assist/claude-hub.git
|
||||
git clone https://github.com/claude-did-this/claude-hub.git
|
||||
cd claude-hub
|
||||
|
||||
# Copy the quickstart environment file
|
||||
@@ -123,7 +123,7 @@ Test it in your own repository by creating an issue and mentioning your bot:
|
||||
## Community & Support
|
||||
|
||||
[](https://discord.gg/yb7hwQjTFg)
|
||||
[](https://docs.intelligence-assist.com/claude-hub/overview)
|
||||
[](https://claude-did-this.com/claude-hub/overview)
|
||||
|
||||
Join our Discord server for help, updates, and to share your experience!
|
||||
|
||||
@@ -138,4 +138,4 @@ Join our Discord server for help, updates, and to share your experience!
|
||||
- Re-run: `./scripts/setup/setup-claude-interactive.sh`
|
||||
- Ensure you have an active Claude.ai Max plan (5x or 20x)
|
||||
|
||||
**Need help?** Ask in our [Discord server](https://discord.gg/yb7hwQjTFg) or check the [full documentation](https://docs.intelligence-assist.com/claude-hub/overview)!
|
||||
**Need help?** Ask in our [Discord server](https://discord.gg/yb7hwQjTFg) or check the [full documentation](https://claude-did-this.com/claude-hub/overview)!
|
||||
14
README.md
14
README.md
@@ -1,16 +1,16 @@
|
||||
# Claude GitHub Webhook
|
||||
|
||||
[](https://discord.gg/yb7hwQjTFg)
|
||||
[](https://github.com/intelligence-assist/claude-hub/actions/workflows/main.yml)
|
||||
[](https://github.com/intelligence-assist/claude-hub/actions/workflows/security.yml)
|
||||
[](https://github.com/claude-did-this/claude-hub/actions/workflows/main.yml)
|
||||
[](https://github.com/claude-did-this/claude-hub/actions/workflows/security.yml)
|
||||
[](test/README.md)
|
||||
[](https://codecov.io/gh/intelligence-assist/claude-hub)
|
||||
[](https://github.com/intelligence-assist/claude-hub/releases)
|
||||
[](https://codecov.io/gh/claude-did-this/claude-hub)
|
||||
[](https://github.com/claude-did-this/claude-hub/releases)
|
||||
[](https://hub.docker.com/r/intelligenceassist/claude-hub)
|
||||
[](package.json)
|
||||
[](LICENSE)
|
||||
|
||||
🚀 **[Quick Start Guide](./QUICKSTART.md)** | 💬 **[Discord](https://discord.gg/yb7hwQjTFg)** | 📚 **[Documentation](https://docs.intelligence-assist.com/claude-hub/overview)** | 📖 **[Complete Setup](./docs/complete-workflow.md)** | 🔐 **[Authentication](./docs/claude-authentication-guide.md)**
|
||||
🚀 **[Quick Start Guide](./QUICKSTART.md)** | 💬 **[Discord](https://discord.gg/yb7hwQjTFg)** | 📚 **[Documentation](https://claude-did-this.com/claude-hub/overview)** | 📖 **[Complete Setup](./docs/complete-workflow.md)** | 🔐 **[Authentication](./docs/claude-authentication-guide.md)**
|
||||
|
||||

|
||||
|
||||
@@ -34,7 +34,7 @@ Claude autonomously handles complete development workflows. It analyzes your ent
|
||||
|
||||
```bash
|
||||
# 1. Clone and configure
|
||||
git clone https://github.com/intelligence-assist/claude-hub.git
|
||||
git clone https://github.com/claude-did-this/claude-hub.git
|
||||
cd claude-hub
|
||||
cp .env.quickstart .env
|
||||
nano .env # Add your GitHub token and bot details
|
||||
@@ -381,7 +381,7 @@ npm run dev
|
||||
|
||||
### Support
|
||||
|
||||
- Report issues: [GitHub Issues](https://github.com/intelligence-assist/claude-hub/issues)
|
||||
- Report issues: [GitHub Issues](https://github.com/claude-did-this/claude-hub/issues)
|
||||
- Detailed troubleshooting: [Complete Workflow Guide](./docs/complete-workflow.md#troubleshooting)
|
||||
|
||||
## License
|
||||
|
||||
@@ -1,336 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# GitHub Actions Runner Management Script
|
||||
# Manage the webhook deployment runner service
|
||||
|
||||
set -e
|
||||
|
||||
# Colors
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
RED='\033[0;31m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
# Configuration
|
||||
SERVICE_NAME="webhook-deployment-runner"
|
||||
RUNNER_DIR="/home/jonflatt/github-actions-runner"
|
||||
RUNNER_USER="jonflatt"
|
||||
|
||||
# Function to print usage
|
||||
usage() {
|
||||
echo -e "${BLUE}GitHub Actions Runner Management Tool${NC}"
|
||||
echo -e "${BLUE}=====================================${NC}"
|
||||
echo -e "\nUsage: $0 [command]"
|
||||
echo -e "\nCommands:"
|
||||
echo -e " ${GREEN}start${NC} - Start the runner service"
|
||||
echo -e " ${GREEN}stop${NC} - Stop the runner service"
|
||||
echo -e " ${GREEN}restart${NC} - Restart the runner service"
|
||||
echo -e " ${GREEN}status${NC} - Check runner service status"
|
||||
echo -e " ${GREEN}logs${NC} - View runner logs (live)"
|
||||
echo -e " ${GREEN}logs-tail${NC} - View last 50 lines of logs"
|
||||
echo -e " ${GREEN}update${NC} - Update runner to latest version"
|
||||
echo -e " ${GREEN}config${NC} - Show runner configuration"
|
||||
echo -e " ${GREEN}health${NC} - Check runner health"
|
||||
echo -e " ${GREEN}jobs${NC} - Show recent job history"
|
||||
echo -e " ${GREEN}cleanup${NC} - Clean up work directory"
|
||||
echo -e " ${GREEN}info${NC} - Show runner information"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Check if running with correct permissions
|
||||
check_permissions() {
|
||||
if [[ $EUID -ne 0 ]] && [[ "$1" =~ ^(start|stop|restart|update)$ ]]; then
|
||||
echo -e "${RED}Error: This command requires sudo privileges${NC}"
|
||||
echo -e "${YELLOW}Run: sudo $0 $1${NC}"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Start the runner
|
||||
start_runner() {
|
||||
echo -e "${YELLOW}Starting runner service...${NC}"
|
||||
systemctl start $SERVICE_NAME
|
||||
sleep 2
|
||||
if systemctl is-active --quiet $SERVICE_NAME; then
|
||||
echo -e "${GREEN}✓ Runner started successfully${NC}"
|
||||
systemctl status $SERVICE_NAME --no-pager | head -n 10
|
||||
else
|
||||
echo -e "${RED}✗ Failed to start runner${NC}"
|
||||
systemctl status $SERVICE_NAME --no-pager
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Stop the runner
|
||||
stop_runner() {
|
||||
echo -e "${YELLOW}Stopping runner service...${NC}"
|
||||
systemctl stop $SERVICE_NAME
|
||||
echo -e "${GREEN}✓ Runner stopped${NC}"
|
||||
}
|
||||
|
||||
# Restart the runner
|
||||
restart_runner() {
|
||||
echo -e "${YELLOW}Restarting runner service...${NC}"
|
||||
systemctl restart $SERVICE_NAME
|
||||
sleep 2
|
||||
if systemctl is-active --quiet $SERVICE_NAME; then
|
||||
echo -e "${GREEN}✓ Runner restarted successfully${NC}"
|
||||
systemctl status $SERVICE_NAME --no-pager | head -n 10
|
||||
else
|
||||
echo -e "${RED}✗ Failed to restart runner${NC}"
|
||||
systemctl status $SERVICE_NAME --no-pager
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Check runner status
|
||||
check_status() {
|
||||
echo -e "${BLUE}Runner Service Status${NC}"
|
||||
echo -e "${BLUE}===================${NC}"
|
||||
systemctl status $SERVICE_NAME --no-pager
|
||||
|
||||
echo -e "\n${BLUE}Runner Process Info${NC}"
|
||||
echo -e "${BLUE}===================${NC}"
|
||||
ps aux | grep -E "(Runner.Listener|run.sh)" | grep -v grep || echo "No runner processes found"
|
||||
}
|
||||
|
||||
# View logs
|
||||
view_logs() {
|
||||
echo -e "${YELLOW}Viewing live logs (Ctrl+C to exit)...${NC}"
|
||||
journalctl -u $SERVICE_NAME -f
|
||||
}
|
||||
|
||||
# View last 50 lines of logs
|
||||
view_logs_tail() {
|
||||
echo -e "${BLUE}Last 50 lines of runner logs${NC}"
|
||||
echo -e "${BLUE}===========================${NC}"
|
||||
journalctl -u $SERVICE_NAME -n 50 --no-pager
|
||||
}
|
||||
|
||||
# Update runner
|
||||
update_runner() {
|
||||
echo -e "${YELLOW}Updating GitHub Actions Runner...${NC}"
|
||||
|
||||
# Stop the service
|
||||
systemctl stop $SERVICE_NAME
|
||||
|
||||
# Get current version
|
||||
CURRENT_VERSION=$($RUNNER_DIR/bin/Runner.Listener --version 2>/dev/null | grep -oP '\d+\.\d+\.\d+' || echo "unknown")
|
||||
echo -e "Current version: ${YELLOW}$CURRENT_VERSION${NC}"
|
||||
|
||||
# Get latest version
|
||||
LATEST_VERSION=$(curl -s https://api.github.com/repos/actions/runner/releases/latest | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
|
||||
echo -e "Latest version: ${GREEN}$LATEST_VERSION${NC}"
|
||||
|
||||
if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
|
||||
echo -e "${GREEN}✓ Runner is already up to date${NC}"
|
||||
systemctl start $SERVICE_NAME
|
||||
return
|
||||
fi
|
||||
|
||||
# Backup current runner
|
||||
echo -e "${YELLOW}Backing up current runner...${NC}"
|
||||
cd $RUNNER_DIR
|
||||
tar -czf runner-backup-$(date +%Y%m%d-%H%M%S).tar.gz bin externals
|
||||
|
||||
# Download and extract new version
|
||||
echo -e "${YELLOW}Downloading new version...${NC}"
|
||||
curl -o actions-runner-linux-x64.tar.gz -L "https://github.com/actions/runner/releases/download/v${LATEST_VERSION}/actions-runner-linux-x64-${LATEST_VERSION}.tar.gz"
|
||||
tar xzf ./actions-runner-linux-x64.tar.gz
|
||||
rm actions-runner-linux-x64.tar.gz
|
||||
|
||||
# Start the service
|
||||
systemctl start $SERVICE_NAME
|
||||
echo -e "${GREEN}✓ Runner updated to version $LATEST_VERSION${NC}"
|
||||
}
|
||||
|
||||
# Show configuration
|
||||
show_config() {
|
||||
echo -e "${BLUE}Runner Configuration${NC}"
|
||||
echo -e "${BLUE}===================${NC}"
|
||||
|
||||
if [ -f "$RUNNER_DIR/.runner" ]; then
|
||||
echo -e "\n${GREEN}Runner Settings:${NC}"
|
||||
cat "$RUNNER_DIR/.runner" | jq '.' 2>/dev/null || cat "$RUNNER_DIR/.runner"
|
||||
fi
|
||||
|
||||
if [ -f "$RUNNER_DIR/.credentials" ]; then
|
||||
echo -e "\n${GREEN}Runner Registration:${NC}"
|
||||
echo "Runner is registered (credentials file exists)"
|
||||
else
|
||||
echo -e "\n${RED}Runner is not configured${NC}"
|
||||
fi
|
||||
|
||||
echo -e "\n${GREEN}Service Configuration:${NC}"
|
||||
systemctl show $SERVICE_NAME | grep -E "(LoadState|ActiveState|SubState|MainPID|Environment)"
|
||||
}
|
||||
|
||||
# Check health
|
||||
check_health() {
|
||||
echo -e "${BLUE}Runner Health Check${NC}"
|
||||
echo -e "${BLUE}==================${NC}"
|
||||
|
||||
# Check service status
|
||||
if systemctl is-active --quiet $SERVICE_NAME; then
|
||||
echo -e "${GREEN}✓ Service is running${NC}"
|
||||
else
|
||||
echo -e "${RED}✗ Service is not running${NC}"
|
||||
fi
|
||||
|
||||
# Check disk space
|
||||
DISK_USAGE=$(df -h $RUNNER_DIR | awk 'NR==2 {print $5}' | sed 's/%//')
|
||||
if [ "$DISK_USAGE" -lt 80 ]; then
|
||||
echo -e "${GREEN}✓ Disk usage: ${DISK_USAGE}%${NC}"
|
||||
else
|
||||
echo -e "${RED}✗ Disk usage: ${DISK_USAGE}% (High)${NC}"
|
||||
fi
|
||||
|
||||
# Check work directory size
|
||||
if [ -d "$RUNNER_DIR/_work" ]; then
|
||||
WORK_SIZE=$(du -sh "$RUNNER_DIR/_work" 2>/dev/null | cut -f1)
|
||||
echo -e "${BLUE}Work directory size: $WORK_SIZE${NC}"
|
||||
fi
|
||||
|
||||
# Check runner connectivity
|
||||
if [ -f "$RUNNER_DIR/.runner" ]; then
|
||||
GITHUB_URL=$(cat "$RUNNER_DIR/.runner" | jq -r '.gitHubUrl' 2>/dev/null || echo "")
|
||||
if [ -n "$GITHUB_URL" ] && curl -s -o /dev/null -w "%{http_code}" "$GITHUB_URL" | grep -q "200"; then
|
||||
echo -e "${GREEN}✓ GitHub connectivity OK${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}⚠ Cannot verify GitHub connectivity${NC}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Show recent jobs
|
||||
show_jobs() {
|
||||
echo -e "${BLUE}Recent Runner Jobs${NC}"
|
||||
echo -e "${BLUE}=================${NC}"
|
||||
|
||||
# Check for job history in work directory
|
||||
if [ -d "$RUNNER_DIR/_work" ]; then
|
||||
echo -e "\n${GREEN}Recent job directories:${NC}"
|
||||
ls -la "$RUNNER_DIR/_work" 2>/dev/null | tail -n 10 || echo "No job directories found"
|
||||
fi
|
||||
|
||||
# Show recent log entries
|
||||
echo -e "\n${GREEN}Recent job activity:${NC}"
|
||||
journalctl -u $SERVICE_NAME --since "1 hour ago" | grep -E "(Running job|Job .* completed|Completed request)" | tail -n 20 || echo "No recent job activity"
|
||||
}
|
||||
|
||||
# Cleanup work directory
|
||||
cleanup_work() {
|
||||
echo -e "${YELLOW}Cleaning up work directory...${NC}"
|
||||
|
||||
if [ ! -d "$RUNNER_DIR/_work" ]; then
|
||||
echo -e "${GREEN}Work directory doesn't exist${NC}"
|
||||
return
|
||||
fi
|
||||
|
||||
# Show current size
|
||||
BEFORE_SIZE=$(du -sh "$RUNNER_DIR/_work" 2>/dev/null | cut -f1)
|
||||
echo -e "Current size: ${YELLOW}$BEFORE_SIZE${NC}"
|
||||
|
||||
# Confirm
|
||||
read -p "Are you sure you want to clean the work directory? (y/N): " confirm
|
||||
if [ "$confirm" != "y" ]; then
|
||||
echo -e "${YELLOW}Cleanup cancelled${NC}"
|
||||
return
|
||||
fi
|
||||
|
||||
# Stop runner
|
||||
systemctl stop $SERVICE_NAME
|
||||
|
||||
# Clean work directory
|
||||
rm -rf "$RUNNER_DIR/_work"/*
|
||||
|
||||
# Start runner
|
||||
systemctl start $SERVICE_NAME
|
||||
|
||||
echo -e "${GREEN}✓ Work directory cleaned${NC}"
|
||||
}
|
||||
|
||||
# Show runner info
|
||||
show_info() {
|
||||
echo -e "${BLUE}GitHub Actions Runner Information${NC}"
|
||||
echo -e "${BLUE}=================================${NC}"
|
||||
|
||||
echo -e "\n${GREEN}Basic Info:${NC}"
|
||||
echo -e "Service Name: ${YELLOW}$SERVICE_NAME${NC}"
|
||||
echo -e "Runner Directory: ${YELLOW}$RUNNER_DIR${NC}"
|
||||
echo -e "Runner User: ${YELLOW}$RUNNER_USER${NC}"
|
||||
|
||||
if [ -f "$RUNNER_DIR/bin/Runner.Listener" ]; then
|
||||
VERSION=$($RUNNER_DIR/bin/Runner.Listener --version 2>/dev/null | grep -oP '\d+\.\d+\.\d+' || echo "unknown")
|
||||
echo -e "Runner Version: ${YELLOW}$VERSION${NC}"
|
||||
fi
|
||||
|
||||
echo -e "\n${GREEN}System Info:${NC}"
|
||||
echo -e "Hostname: ${YELLOW}$(hostname)${NC}"
|
||||
echo -e "OS: ${YELLOW}$(lsb_release -d | cut -f2)${NC}"
|
||||
echo -e "Kernel: ${YELLOW}$(uname -r)${NC}"
|
||||
echo -e "Architecture: ${YELLOW}$(uname -m)${NC}"
|
||||
|
||||
echo -e "\n${GREEN}Docker Info:${NC}"
|
||||
if command -v docker &> /dev/null; then
|
||||
DOCKER_VERSION=$(docker --version | awk '{print $3}' | sed 's/,$//')
|
||||
echo -e "Docker Version: ${YELLOW}$DOCKER_VERSION${NC}"
|
||||
|
||||
if groups $RUNNER_USER | grep -q docker; then
|
||||
echo -e "Docker Access: ${GREEN}✓ User in docker group${NC}"
|
||||
else
|
||||
echo -e "Docker Access: ${RED}✗ User not in docker group${NC}"
|
||||
fi
|
||||
else
|
||||
echo -e "${RED}Docker not installed${NC}"
|
||||
fi
|
||||
|
||||
echo -e "\n${GREEN}Labels:${NC}"
|
||||
echo -e "${YELLOW}self-hosted,linux,x64,deployment,webhook-cd${NC}"
|
||||
}
|
||||
|
||||
# Main logic
|
||||
check_permissions "$1"
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start_runner
|
||||
;;
|
||||
stop)
|
||||
stop_runner
|
||||
;;
|
||||
restart)
|
||||
restart_runner
|
||||
;;
|
||||
status)
|
||||
check_status
|
||||
;;
|
||||
logs)
|
||||
view_logs
|
||||
;;
|
||||
logs-tail)
|
||||
view_logs_tail
|
||||
;;
|
||||
update)
|
||||
update_runner
|
||||
;;
|
||||
config)
|
||||
show_config
|
||||
;;
|
||||
health)
|
||||
check_health
|
||||
;;
|
||||
jobs)
|
||||
show_jobs
|
||||
;;
|
||||
cleanup)
|
||||
cleanup_work
|
||||
;;
|
||||
info)
|
||||
show_info
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Clean runner configuration - no hacks, just proper setup
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "🔧 Configuring GitHub Actions runner for clean builds..."
|
||||
|
||||
# 1. Set proper umask in runner service
|
||||
sudo tee /etc/systemd/system/actions.runner.*.service.d/override.conf << 'EOF'
|
||||
[Service]
|
||||
UMask=0022
|
||||
Environment=UMASK=022
|
||||
EOF
|
||||
|
||||
# 2. Configure runner user shell
|
||||
sudo tee -a ~gh-runner/.bashrc << 'EOF'
|
||||
# Set proper umask for all processes
|
||||
umask 022
|
||||
|
||||
# Clean workspace function
|
||||
clean_workspace() {
|
||||
if [ -n "${GITHUB_WORKSPACE:-}" ]; then
|
||||
sudo rm -rf "${GITHUB_WORKSPACE}" 2>/dev/null || true
|
||||
mkdir -p "${GITHUB_WORKSPACE}"
|
||||
fi
|
||||
}
|
||||
EOF
|
||||
|
||||
# 3. Add pre-action script to runner
|
||||
sudo tee /opt/actions-runner/pre-action.sh << 'EOF'
|
||||
#!/bin/bash
|
||||
# Clean workspace before each action
|
||||
umask 022
|
||||
sudo rm -rf "${GITHUB_WORKSPACE}" 2>/dev/null || true
|
||||
mkdir -p "${GITHUB_WORKSPACE}"
|
||||
EOF
|
||||
|
||||
sudo chmod +x /opt/actions-runner/pre-action.sh
|
||||
|
||||
# 4. Restart runner services
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart actions.runner.*.service
|
||||
|
||||
echo "✅ Runner configured for clean builds"
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Setup clean Docker-based GitHub Actions runners
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "🐳 Setting up Docker-based GitHub Actions runners..."
|
||||
|
||||
# Create docker-compose for runners
|
||||
cat > docker-compose.runners.yml << 'EOF'
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
github-runner-1:
|
||||
image: myoung34/github-runner:latest
|
||||
environment:
|
||||
REPO_URL: https://github.com/intelligence-assist/claude-hub
|
||||
RUNNER_TOKEN: ${RUNNER_TOKEN}
|
||||
RUNNER_NAME: docker-runner-1
|
||||
RUNNER_WORKDIR: /tmp/runner/work
|
||||
RUNNER_GROUP: default
|
||||
LABELS: linux,x64,docker
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- runner1-work:/tmp/runner/work
|
||||
restart: unless-stopped
|
||||
|
||||
github-runner-2:
|
||||
image: myoung34/github-runner:latest
|
||||
environment:
|
||||
REPO_URL: https://github.com/intelligence-assist/claude-hub
|
||||
RUNNER_TOKEN: ${RUNNER_TOKEN}
|
||||
RUNNER_NAME: docker-runner-2
|
||||
RUNNER_WORKDIR: /tmp/runner/work
|
||||
RUNNER_GROUP: default
|
||||
LABELS: linux,x64,docker
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- runner2-work:/tmp/runner/work
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
runner1-work:
|
||||
runner2-work:
|
||||
EOF
|
||||
|
||||
echo "✅ Docker runner configuration created"
|
||||
echo "📝 To deploy:"
|
||||
echo " 1. Get runner token from GitHub repo settings"
|
||||
echo " 2. export RUNNER_TOKEN=your_token"
|
||||
echo " 3. docker-compose -f docker-compose.runners.yml up -d"
|
||||
@@ -1,119 +0,0 @@
|
||||
#!/bin/bash
|
||||
# fix-runner-permissions.sh
|
||||
# Permanent fix for GitHub Actions runner permission issues
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "🔧 Fixing GitHub Actions runner permission issues..."
|
||||
|
||||
# 1. Fix existing coverage directories
|
||||
echo "📁 Cleaning existing coverage directories..."
|
||||
find /home/gh-runner* -name "coverage" -type d 2>/dev/null | while read -r dir; do
|
||||
echo " Fixing permissions for: $dir"
|
||||
sudo chmod -R 755 "$dir" 2>/dev/null || true
|
||||
sudo rm -rf "$dir" 2>/dev/null || true
|
||||
done
|
||||
|
||||
# 2. Set default umask for GitHub Actions runner
|
||||
echo "🔒 Setting default umask for runner processes..."
|
||||
RUNNER_PROFILE="/home/gh-runner*/.bashrc"
|
||||
if ! grep -q "umask 022" $RUNNER_PROFILE 2>/dev/null; then
|
||||
echo "umask 022" | sudo tee -a $RUNNER_PROFILE
|
||||
fi
|
||||
|
||||
# 3. Create systemd drop-in for runner service
|
||||
echo "⚙️ Creating systemd configuration..."
|
||||
sudo mkdir -p /etc/systemd/system/actions.runner.*.service.d/
|
||||
cat << 'EOF' | sudo tee /etc/systemd/system/actions.runner.*.service.d/permissions.conf
|
||||
[Service]
|
||||
# Set umask for all processes
|
||||
UMask=0022
|
||||
|
||||
# Ensure proper file permissions
|
||||
ExecStartPre=/bin/bash -c 'find /home/gh-runner*/actions-runner/_work -name "coverage" -type d -exec chmod -R 755 {} \; 2>/dev/null || true'
|
||||
ExecStartPre=/bin/bash -c 'find /home/gh-runner*/actions-runner/_work -name "node_modules" -type d -exec chmod -R 755 {} \; 2>/dev/null || true'
|
||||
EOF
|
||||
|
||||
# 4. Reload systemd and restart runner services
|
||||
echo "🔄 Reloading systemd configuration..."
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
# 5. Create cleanup script for cron
|
||||
echo "🕐 Setting up periodic cleanup..."
|
||||
cat << 'EOF' | sudo tee /usr/local/bin/github-runner-cleanup.sh
|
||||
#!/bin/bash
|
||||
# Periodic cleanup of runner workspaces
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Clean up old coverage directories
|
||||
find /home/gh-runner*/actions-runner/_work -name "coverage" -type d -mtime +1 -exec rm -rf {} \; 2>/dev/null || true
|
||||
|
||||
# Fix permissions on current workspaces
|
||||
find /home/gh-runner*/actions-runner/_work -type d -exec chmod 755 {} \; 2>/dev/null || true
|
||||
find /home/gh-runner*/actions-runner/_work -type f -exec chmod 644 {} \; 2>/dev/null || true
|
||||
|
||||
# Clean up node_modules with restricted permissions
|
||||
find /home/gh-runner*/actions-runner/_work -name "node_modules" -type d -exec chmod -R 755 {} \; 2>/dev/null || true
|
||||
|
||||
echo "$(date): GitHub runner cleanup completed"
|
||||
EOF
|
||||
|
||||
sudo chmod +x /usr/local/bin/github-runner-cleanup.sh
|
||||
|
||||
# 6. Add to cron (run every 30 minutes)
|
||||
if ! sudo crontab -l 2>/dev/null | grep -q "github-runner-cleanup"; then
|
||||
(sudo crontab -l 2>/dev/null; echo "*/30 * * * * /usr/local/bin/github-runner-cleanup.sh >> /var/log/github-runner-cleanup.log 2>&1") | sudo crontab -
|
||||
fi
|
||||
|
||||
# 7. Set proper directory permissions for runner users
|
||||
echo "👤 Setting runner user permissions..."
|
||||
for runner_home in /home/gh-runner*; do
|
||||
if [ -d "$runner_home" ]; then
|
||||
sudo chown -R "$(basename "$runner_home")":"$(basename "$runner_home")" "$runner_home"
|
||||
sudo chmod 755 "$runner_home"
|
||||
fi
|
||||
done
|
||||
|
||||
# 8. Create a pre-checkout script
|
||||
echo "📋 Creating pre-checkout script..."
|
||||
cat << 'EOF' | sudo tee /usr/local/bin/pre-checkout-cleanup.sh
|
||||
#!/bin/bash
|
||||
# Pre-checkout cleanup script
|
||||
# Usage: /usr/local/bin/pre-checkout-cleanup.sh [workspace_path]
|
||||
|
||||
WORKSPACE_PATH="${1:-$GITHUB_WORKSPACE}"
|
||||
WORKSPACE_PATH="${WORKSPACE_PATH:-$(pwd)}"
|
||||
|
||||
echo "🧹 Cleaning workspace: $WORKSPACE_PATH"
|
||||
|
||||
# Remove coverage directories with any permissions
|
||||
find "$WORKSPACE_PATH" -name "coverage" -type d -exec chmod -R 755 {} \; 2>/dev/null || true
|
||||
find "$WORKSPACE_PATH" -name "coverage" -type d -exec rm -rf {} \; 2>/dev/null || true
|
||||
|
||||
# Remove node_modules with restricted permissions
|
||||
find "$WORKSPACE_PATH" -name "node_modules" -type d -exec chmod -R 755 {} \; 2>/dev/null || true
|
||||
|
||||
# Remove any .git directories that might have permission issues
|
||||
find "$WORKSPACE_PATH" -name ".git" -type d -exec chmod -R 755 {} \; 2>/dev/null || true
|
||||
|
||||
# Set proper umask for subsequent operations
|
||||
umask 022
|
||||
|
||||
echo "✅ Workspace cleaned successfully"
|
||||
EOF
|
||||
|
||||
sudo chmod +x /usr/local/bin/pre-checkout-cleanup.sh
|
||||
|
||||
echo "✅ GitHub Actions runner permission fixes applied!"
|
||||
echo "📝 Summary of changes:"
|
||||
echo " - Set default umask to 022 for all runner processes"
|
||||
echo " - Created systemd drop-in for automatic cleanup"
|
||||
echo " - Added periodic cleanup cron job (every 30 minutes)"
|
||||
echo " - Created pre-checkout cleanup script"
|
||||
echo " - Fixed existing permission issues"
|
||||
echo ""
|
||||
echo "🔄 Restart runner services for changes to take effect:"
|
||||
echo " sudo systemctl restart actions.runner.*.service"
|
||||
echo ""
|
||||
echo "🧪 Test the fix by running a workflow with coverage generation."
|
||||
@@ -17,14 +17,14 @@ conditionalDescribe(
|
||||
echo "Claude API test complete"
|
||||
`,
|
||||
env: {
|
||||
REPO_FULL_NAME: 'intelligence-assist/claude-hub',
|
||||
REPO_FULL_NAME: 'claude-did-this/claude-hub',
|
||||
ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY || 'test-key'
|
||||
}
|
||||
});
|
||||
|
||||
assertCommandSuccess(result);
|
||||
expect(result.stdout).toContain('Claude API test complete');
|
||||
expect(result.stdout).toContain('Repository: intelligence-assist/claude-hub');
|
||||
expect(result.stdout).toContain('Repository: claude-did-this/claude-hub');
|
||||
});
|
||||
|
||||
test('should validate Claude API environment setup', async () => {
|
||||
@@ -53,7 +53,7 @@ conditionalDescribe(
|
||||
const result = await containerExecutor.exec({
|
||||
entrypoint: '/bin/bash',
|
||||
command: 'echo "Container API test"',
|
||||
repo: 'intelligence-assist/test-repo',
|
||||
repo: 'claude-did-this/test-repo',
|
||||
env: {
|
||||
CONTAINER_MODE: 'api-test',
|
||||
API_ENDPOINT: 'test-endpoint'
|
||||
|
||||
@@ -107,7 +107,7 @@ conditionalDescribe(
|
||||
const result = await containerExecutor.exec({
|
||||
entrypoint: '/bin/bash',
|
||||
command: 'echo "Repository configuration test"',
|
||||
repo: 'intelligence-assist/test-repo',
|
||||
repo: 'claude-did-this/test-repo',
|
||||
env: {
|
||||
ISSUE_NUMBER: '42',
|
||||
IS_PULL_REQUEST: 'true'
|
||||
|
||||
@@ -19,7 +19,7 @@ conditionalDescribe(
|
||||
test('should handle complete environment setup', async () => {
|
||||
const result = await containerExecutor.execFullFlow({
|
||||
env: {
|
||||
TEST_REPO_FULL_NAME: 'intelligence-assist/test-repo',
|
||||
TEST_REPO_FULL_NAME: 'claude-did-this/test-repo',
|
||||
COMMAND: 'echo "Full workflow test"'
|
||||
}
|
||||
});
|
||||
@@ -34,7 +34,7 @@ conditionalDescribe(
|
||||
const result = await containerExecutor.exec({
|
||||
interactive: true,
|
||||
env: {
|
||||
REPO_FULL_NAME: 'intelligence-assist/claude-hub',
|
||||
REPO_FULL_NAME: 'claude-did-this/claude-hub',
|
||||
ISSUE_NUMBER: '1',
|
||||
IS_PULL_REQUEST: 'false',
|
||||
COMMAND: 'echo "Claude Code Docker test"',
|
||||
@@ -60,7 +60,7 @@ conditionalDescribe(
|
||||
echo "Environment validation complete"
|
||||
`,
|
||||
env: {
|
||||
REPO_FULL_NAME: 'intelligence-assist/claude-hub',
|
||||
REPO_FULL_NAME: 'claude-did-this/claude-hub',
|
||||
ISSUE_NUMBER: '42',
|
||||
COMMAND: 'validate environment'
|
||||
}
|
||||
@@ -76,7 +76,7 @@ conditionalDescribe(
|
||||
const result = await containerExecutor.exec({
|
||||
interactive: true,
|
||||
env: {
|
||||
REPO_FULL_NAME: 'intelligence-assist/claude-hub',
|
||||
REPO_FULL_NAME: 'claude-did-this/claude-hub',
|
||||
ISSUE_NUMBER: '1',
|
||||
IS_PULL_REQUEST: 'false',
|
||||
COMMAND: 'echo "Integration test complete"',
|
||||
@@ -96,7 +96,7 @@ conditionalDescribe(
|
||||
interactive: true,
|
||||
volumes: [`${homeDir}/.aws:/home/node/.aws:ro`],
|
||||
env: {
|
||||
REPO_FULL_NAME: 'intelligence-assist/test-bedrock',
|
||||
REPO_FULL_NAME: 'claude-did-this/test-bedrock',
|
||||
ISSUE_NUMBER: '1',
|
||||
IS_PULL_REQUEST: 'false',
|
||||
COMMAND: 'echo "Bedrock integration test"',
|
||||
|
||||
@@ -70,7 +70,7 @@ conditionalDescribe(
|
||||
`,
|
||||
env: {
|
||||
GITHUB_TOKEN: process.env.GITHUB_TOKEN || 'test-token',
|
||||
REPO_FULL_NAME: 'intelligence-assist/claude-hub'
|
||||
REPO_FULL_NAME: 'claude-did-this/claude-hub'
|
||||
},
|
||||
timeout: 15000
|
||||
});
|
||||
@@ -117,7 +117,7 @@ conditionalDescribe(
|
||||
`,
|
||||
env: {
|
||||
GITHUB_TOKEN: process.env.GITHUB_TOKEN || 'test-token',
|
||||
REPO_FULL_NAME: 'intelligence-assist/claude-hub',
|
||||
REPO_FULL_NAME: 'claude-did-this/claude-hub',
|
||||
ISSUE_NUMBER: '1'
|
||||
},
|
||||
timeout: 15000
|
||||
@@ -166,7 +166,7 @@ conditionalDescribe(
|
||||
`,
|
||||
env: {
|
||||
GITHUB_TOKEN: process.env.GITHUB_TOKEN || 'test-token',
|
||||
REPO_FULL_NAME: 'intelligence-assist/claude-hub',
|
||||
REPO_FULL_NAME: 'claude-did-this/claude-hub',
|
||||
ISSUE_NUMBER: '1',
|
||||
IS_PULL_REQUEST: 'false'
|
||||
},
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Test Runner Access
|
||||
|
||||
This file tests if our self-hosted runner is working properly.
|
||||
Reference in New Issue
Block a user