k8s/github-actions-runner/setup-github-token.sh
#!/bin/bash
# Script to help set up GitHub runner tokens

echo "=== GitHub Actions Runner Setup for whofi ==="
echo ""
echo "You need to create a GitHub token with the following permissions:"
echo "1. For Personal Access Token (classic):"
echo "   - repo (Full control of private repositories)"
echo "   - workflow (Update GitHub Action workflows)"
echo "   - admin:org (if using organization runners)"
echo ""
echo "2. For Fine-grained Personal Access Token:"
echo "   - Repository permissions:"
echo "     - Actions: Read"
echo "     - Administration: Read and Write"
echo "     - Metadata: Read"
echo ""
echo "3. Or use a GitHub App with:"
echo "   - Actions: Read"
echo "   - Administration: Read and Write"
echo ""
echo "To get a runner registration token:"
echo "1. Go to: https://github.com/jedarden/whofi/settings/actions/runners"
echo "2. Click 'New self-hosted runner'"
echo "3. Copy the token from the configuration command"
echo ""
echo "Then update the secret:"
echo "kubectl create secret generic github-runner-secret \\"
echo "  --from-literal=GITHUB_TOKEN=<your-github-token> \\"
echo "  --from-literal=REPO_URL=https://github.com/jedarden/whofi \\"
echo "  --from-literal=RUNNER_TOKEN=<your-runner-token> \\"
echo "  -n github-actions-runners --dry-run=client -o yaml | kubectl apply -f -"