33 lines
932 B
Bash
33 lines
932 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
cd "$PROJECT_ROOT"
|
|
|
|
check_one() {
|
|
local source_rel="$1"
|
|
local target_rel="$2"
|
|
|
|
if [[ ! -f "$source_rel" ]]; then
|
|
echo "[✗] Missing workflow source: $source_rel" >&2
|
|
return 1
|
|
fi
|
|
|
|
if [[ ! -f "$target_rel" ]]; then
|
|
echo "[✗] Missing generated workflow: $target_rel" >&2
|
|
return 1
|
|
fi
|
|
|
|
if ! diff -u "$source_rel" "$target_rel" >/dev/null; then
|
|
echo "[✗] Workflow drift detected: $target_rel does not match $source_rel" >&2
|
|
echo " Run: bash scripts/verify/sync-gitea-workflows.sh" >&2
|
|
return 1
|
|
fi
|
|
|
|
echo "[✓] $target_rel matches $source_rel"
|
|
}
|
|
|
|
check_one ".gitea/workflow-sources/deploy-to-phoenix.yml" ".gitea/workflows/deploy-to-phoenix.yml"
|
|
check_one ".gitea/workflow-sources/validate-on-pr.yml" ".gitea/workflows/validate-on-pr.yml"
|