#!/usr/bin/env bash set -euo pipefail mode="${1:-all}" case "$mode" in fast) job="fast-gate" ;; docker) job="container" ;; all) job="" ;; cleanup) job="cleanup" ;; *) echo "Usage: $0 {fast|docker|all|cleanup}" >&2 exit 2 ;; esac command -v act >/dev/null 2>&1 || { echo "act is required: https://nektosact.com/installation/index.html" >&2 exit 1 } docker info >/dev/null 2>&1 || { echo "Docker is not running" >&2 exit 1 } if [[ -z "${DOCKER_HOST:-}" ]]; then DOCKER_HOST=$(docker context inspect --format '{{.Endpoints.docker.Host}}' 2>/dev/null || true) export DOCKER_HOST fi head_sha=$(git rev-parse HEAD) base_sha=$(git rev-parse HEAD~1 2>/dev/null || echo "$head_sha") head_ref=$(git branch --show-current) head_ref=${head_ref:-act-local} event_file=$(mktemp "${TMPDIR:-/tmp}/homarr-act-event.XXXXXX") trap 'rm -f "$event_file"' EXIT json_escape() { printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g; s/\t/\\t/g'; } if [[ "$mode" == "cleanup" ]]; then event_name="workflow_dispatch" cat >"$event_file" <"$event_file" <