Files
stack/.gitea/workflows/zotero-sync.yml
kert 73407bf089 feat(bib,zot): deterministic URL lookup + nightly library-wide merge-dupes (refs #665)
find_item_by_url now ORDER BY i.itemID so bib.sync consistently keeps
updating the same "earliest" item when duplicates exist — the one
zot.merge treats as the merge keeper. Wires --merge-dupes/--no-merge-dupes
(default off) into `stack bib sync-zotero`, running merge_url_duplicates
library-wide after the push, inside the same stop window.
--dedupe-collection stays but is documented as deprecated (deletes
without merging). Regenerates .gitea/workflows/zotero-sync.yml (source:
dev/scripts/backends/gitea.py) to swap --dedupe-collection Cmsupdates
for --merge-dupes, since listserv re-sends are now aliased at ingest
(Task 3) and any same-URL twins are merged, not deleted.
2026-08-26 12:53:27 -04:00

60 lines
1.9 KiB
YAML

# DO NOT EDIT — generated by gen_config.py from stack.toml
# Re-generate: uv run python dev/scripts/gen_config.py
name: Zotero Sync
on:
workflow_dispatch:
schedule:
- cron: "15 4 * * *"
jobs:
zotero-sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
env:
UV_INSTALL_DIR: /usr/local/bin
- name: Stop zotero (release SQLite write lock)
run: docker stop zotero
- name: Sync mail-ingested bib items into Zotero
# --merge-dupes: listserv re-sends are now aliased at ingest
# (Task 3), and any same-URL twins that still land in Zotero are
# merged (union tags/collections/notes/attachments, keep-earliest)
# rather than deleted.
run: |
docker exec api uv run --no-sync \
stack bib sync-zotero --tag source:email --no-hold \
--merge-dupes
- name: Sync Federal Register rule items into Zotero
# Rule items only ever reached Zotero via one-off manual syncs
# (P36 step 5); P37 skipped that step and the CY2027 NPRM never
# arrived (#626/#627). Tag-scoped: a full unscoped sync would
# hydrate ~180k bib items.
run: |
docker exec api uv run --no-sync \
stack bib sync-zotero --tag source:federal-register --no-hold
- name: Restart zotero
if: always()
run: docker start zotero
- name: File failure issue
if: failure()
env:
GITEA_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: |
uv sync --no-dev --quiet 2>/dev/null || true
uv run python -m api.diag.ci \
--workflow "Zotero Sync" --job "zotero-sync" \
--run "${{ github.run_number }}" \
--sha "${{ github.sha }}" \
--ref "${{ github.ref }}" || true