From acde6560a5b0ce75273e0103543da8af02c482db Mon Sep 17 00:00:00 2001 From: Hironori Takahashi Date: Fri, 27 Mar 2026 22:08:48 +0900 Subject: [PATCH] fix: read .templatesyncignore from template remote in GitLab sync The sync script was reading the local .templatesyncignore to build the include list. When the template adds new files and updates .templatesyncignore in the same commit, the local copy doesn't include the new entries yet, so the new files are never copied. Read from template/main:.templatesyncignore instead, falling back to the local copy if unavailable. --- .gitlab/sync-template.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitlab/sync-template.yml b/.gitlab/sync-template.yml index a90236a..a2d5348 100644 --- a/.gitlab/sync-template.yml +++ b/.gitlab/sync-template.yml @@ -29,16 +29,20 @@ template_sync: git remote add template "$FETCH_URL" || true git fetch template main - # Build include list from .templatesyncignore (whitelist: :! prefixed lines) + # Build include list from TEMPLATE's .templatesyncignore (whitelist: :! prefixed lines) + # Use template's version so newly added files are included in the same sync. INCLUDE="" - if [ -f .templatesyncignore ]; then + SYNCIGNORE=$(git show template/main:.templatesyncignore 2>/dev/null || cat .templatesyncignore 2>/dev/null || true) + if [ -n "$SYNCIGNORE" ]; then while IFS= read -r line || [ -n "$line" ]; do line=$(echo "$line" | sed 's/#.*//' | xargs) [ -z "$line" ] && continue case "$line" in :!*) INCLUDE="$INCLUDE ${line#:!}" ;; esac - done < .templatesyncignore + done <