Add a workflow for generating contributor pages #18

Merged
mih merged 1 commit from msz/www.trr379.de:contributor-pages-workflow into main 2026-02-12 04:58:14 +00:00

View file

@ -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 <<EOF
url=${{ forgejo.server_url }}
username=${{ forgejo.actor }}
password=${{ forgejo.token }}
EOF
echo OK
- name: Process metadata
run: |
cd ${{ steps.codecheckout.outputs.path }}
uv sync --locked
dtc read-pages https://pool.v0.trr379.de/api/public/records/p/TRR379Project > /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
msz marked this conversation as resolved Outdated

I have not run the code in this action, but I noticed when skimming though that the "process metadata" step uses person.py to create contents in {...}/contents/contributors, but this git add stages content/publications, and the commit message is on updating publication. Am I missing something, or is this a copy-paste error from a different action?

I have not run the code in this action, but I noticed when skimming though that the "process metadata" step uses ``person.py`` to create contents in ``{...}/contents/contributors``, but this ``git add`` stages ``content/publications``, and the commit message is on updating publication. Am I missing something, or is this a copy-paste error from a different action?

Copy-paste error. I knew it wouldn't work on the first try - thank you for spotting that!

Copy-paste error. I knew it wouldn't work on the first try - thank you for spotting that!
git commit -m "Auto-update publications" && result=t || result=nil
git push origin
echo "committed=${result}" >> $FORGEJO_OUTPUT