From 22de46eedccb1cfff94f0634d992f6a886484820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szczepanik?= Date: Fri, 6 Feb 2026 19:42:21 +0100 Subject: [PATCH] Add a workflow for generating contributor pages --- .forgejo/workflows/contributors.yml | 75 +++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .forgejo/workflows/contributors.yml diff --git a/.forgejo/workflows/contributors.yml b/.forgejo/workflows/contributors.yml new file mode 100644 index 00000000..44eb193e --- /dev/null +++ b/.forgejo/workflows/contributors.yml @@ -0,0 +1,75 @@ +name: Create publication pages + +on: + workflow_dispatch: + +jobs: + create_pages: + runs-on: debian-latest + if: ${{ forgejo.repository == 'q04/www.trr379.de' }} + outputs: + committed: ${{ steps.commit.outputs.committed }} + + steps: + - name: Checkout this + id: websitecheckout + uses: https://hub.datalad.org/forgejo/datalad-clone-action@v1 + with: + ref: main + get_file_content: false + recursive: false + + - name: Checkout code + id: codecheckout + uses: https://hub.datalad.org/forgejo/datalad-clone-action@v1 + with: + repository: q02/pool-publication-page + get_file_content: false + path: code + + - name: Download extra data + id: datacheckout + uses: https://hub.datalad.org/forgejo/datalad-clone-action@v1 + with: + repository: https://hub.trr379.de/q02/pool-publication-page + path: /tmp/extradata + get_content: v2.2-2026-01-29-ror-data.parquet + + - name: Install uv + run: curl -LsSf https://astral.sh/uv/install.sh | sh + + - name: Install qrg & dtc suites + run: | + uv tool install https://hub.psychoinformatics.de/datalink/query-rse-group.git + uv tool install dump-things-pyclient + + - name: Configure Git + run: | + git config --global user.name "Forgejo Actions" + git config --global user.email "forgejo-actions@hub.trr379.de" + git config --global credential.helper cache + git credential approve < /tmp/projects.jsonl + dtc read-pages https://pool.v0.trr379.de/api/public/records/p/TRR379Person \ + | qrg inline-records --api-url https://pool.v0.trr379.de/api/ -c public -p delegated_by \ + | uv run filters/join-association.py --inline --pop --field-name x_associated_projects - /tmp/projects.jsonl associated_with \ + | uv run filters/infer-site.py - ${{ steps.datacheckout.outputs.path }}/v2.2-2026-01-29-ror-data.parquet - \ + | uv run person.py - ${{ steps.websitecheckout.outputs.path }}/content/contributors + + - name: Commit and push updates + id: commit + run: | + git add content/contributors + git commit -m "Auto-update publications" && result=t || result=nil + git push origin + echo "committed=${result}" >> $FORGEJO_OUTPUT -- 2.52.0