NFDI4BIOIMAGE #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Process Approved Issues | |
| on: | |
| issues: | |
| types: [labeled] | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| process: | |
| if: contains(join(github.event.issue.labels.*.name, ' '), 'submission-approved') | |
| runs-on: [self-hosted, juist-hosted] | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| set -euo pipefail | |
| echo '==> Installing dependencies' | |
| python -m pip install --upgrade pip | |
| pip install pyyaml pandas rdflib argparse | |
| echo '✅ Dependencies installed' | |
| - name: Save issue body (API) | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| const issue_number = context.issue.number; | |
| const { data: issue } = await github.rest.issues.get({ owner, repo, issue_number }); | |
| const fs = require('fs'); | |
| fs.writeFileSync('issue_body.txt', issue.body ?? '', { encoding: 'utf8' }); | |
| core.info(`Wrote ${ (issue.body ?? '').length } bytes to issue_body.txt`); | |
| - name: Extract YAML | |
| run: | | |
| set -euo pipefail | |
| echo '==> Extracting YAML' | |
| python scripts/extract_yaml.py issue_body.txt payload.yaml | |
| echo 'YAML content:' | |
| cat payload.yaml | |
| echo '✅ YAML extracted' | |
| - name: Run pipeline | |
| run: | | |
| set -euo pipefail | |
| echo '==> Running pipeline script' | |
| python scripts/convert_yaml_to_rdf.py --yml_in payload.yaml --rdf_in $(ls -t /home/ubuntu/data/*.ttl | head -n 1) --out_dir /home/ubuntu/data/ | |
| bash scripts/upload_submission_to_qlever.sh | |
| echo '✅ Pipeline finished' | |
| - name: Done | |
| run: echo '🎉 All steps completed successfully' |