#!/bin/bash set -euo pipefail INSTANCE="${1:?Usage: gitea-act-runner-setup }" RUNNER_DIR="/var/lib/gitea/runners/${INSTANCE}" CONFIG="/etc/gitea/runners/${INSTANCE}.yaml" if [ ! -f "$CONFIG" ]; then echo "Config not found: $CONFIG" echo "Copy /etc/gitea/runners/runner1.yaml to $CONFIG first." exit 1 fi mkdir -p "$RUNNER_DIR" chown gitea-runner:gitea-runner "$RUNNER_DIR" # Ensure Podman API socket is running systemctl enable --now gitea-runner-podman.service cd "$RUNNER_DIR" sudo -u gitea-runner gitea-act-runner register -c "$CONFIG"