From 598aa5d9e74022de6c5b03dd88b8b60a4d06aeaa Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Wed, 26 Aug 2026 23:40:48 +0100 Subject: [PATCH] fix: replace generated curated resources --- .github/workflows/deploy.yaml | 7 +++++++ content/resources/resource.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index c9cba7b08eb..2b5a3cec30f 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -44,6 +44,13 @@ jobs: # ======================= # Data Artifact Retrieval # ======================= + # The repository contains a generated seed copy of curated resources. + # Remove it before overlaying the artifact so rows removed from the + # source sheet cannot survive in the deployed site. + - name: Clear generated curated resources + run: | + find content/curated_resources -maxdepth 1 -type f ! -name '_index.md' -delete + - name: Try to download data artifact id: download-artifact uses: dawidd6/action-download-artifact@07ab29fd4a977ae4d2b275087cf67563dfdf0295 diff --git a/content/resources/resource.py b/content/resources/resource.py index b8a35ebfe2a..6066c7b2efd 100644 --- a/content/resources/resource.py +++ b/content/resources/resource.py @@ -87,6 +87,12 @@ def convert_row_to_file(df, fpath): If there are duplicates, an index is appended to the filename. """ + # Replace the generated collection rather than leaving files for rows that + # have been removed from the source sheet. + for path in fpath.iterdir(): + if path.is_file() and path.name != '_index.md': + path.unlink() + # Track filenames to handle duplicates filename_counts = {}