From 25b8024bf59f6b35a0e11a190975276e484adcb6 Mon Sep 17 00:00:00 2001 From: Bausager Date: Mon, 6 Oct 2025 21:35:14 +0200 Subject: [PATCH] Update .gitea/workflows/sync-public.yml --- .gitea/workflows/sync-public.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/sync-public.yml b/.gitea/workflows/sync-public.yml index c76e7b4..66c60e1 100644 --- a/.gitea/workflows/sync-public.yml +++ b/.gitea/workflows/sync-public.yml @@ -2,7 +2,7 @@ name: Sync public mirror on: push: - branches: [ main ] # change if your default branch is different + branches: [ main ] jobs: sync: @@ -43,10 +43,10 @@ jobs: echo "Generating rsync include list from $KEEP_FILE" : > "$INCLUDE_FILE" echo "## Generated from $KEEP_FILE" >> "$INCLUDE_FILE" - echo "+ */" >> "$INCLUDE_FILE" # allow directory traversal + echo "+ */" >> "$INCLUDE_FILE" while IFS= read -r line; do - line="${line%%#*}" # strip comments + line="${line%%#*}" line="$(echo "$line" | xargs || true)" [ -z "$line" ] && continue case "$line" in @@ -60,25 +60,25 @@ jobs: esac done < "$KEEP_FILE" - echo "- *" >> "$INCLUDE_FILE" # exclude everything else - + echo "- *" >> "$INCLUDE_FILE" echo "Rsync include rules:" cat "$INCLUDE_FILE" - # Sync only allowed files to the public repo + echo "Syncing files to /tmp/public" rsync -a --delete --prune-empty-dirs \ + --exclude '.git/' \ --include-from="$INCLUDE_FILE" \ ./ /tmp/public/ cd /tmp/public - git config user.name "Gitea CI" + git config user.name "Gitea CI" git config user.email "ci@bausager.org" git add -A if git diff --cached --quiet; then - echo "No public-eligible changes to push." + echo "✅ No public-eligible changes to push." else - echo "Pushing filtered subset to Flux-oss..." + echo "🚀 Pushing filtered subset to Flux-oss..." git commit -m "Sync public subset from Flux (private)" git push origin HEAD:main fi