Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
#!/bin/bash
set -e

# Clean up any existing SSH agents and sockets on startup
cleanup_existing_ssh() {
echo "Cleaning up existing SSH agents and sockets..."

# Kill any existing SSH agents
pkill -f ssh-agent || true

# Remove any existing SSH socket files
find /tmp -name "ssh*" -type s -delete 2>/dev/null || true
find /tmp -name "agent.*" -type s -delete 2>/dev/null || true

echo "SSH cleanup completed"
}

# Handle Docker socket permissions
if [ -e /var/run/docker.sock ]; then
sudo chown root:docker /var/run/docker.sock
sudo chmod 660 /var/run/docker.sock
fi

# Clean up existing SSH resources
cleanup_existing_ssh

# Ensure the required environment variables are set
if [ -z "$GITHUB_URL" ] || [ -z "$RUNNER_TOKEN" ]; then
echo "Error: GITHUB_URL and RUNNER_TOKEN environment variables must be set."
Expand Down
Loading