Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions content/resources/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down
Loading