From c8759892717307da4f936bb6eb98f1b544700944 Mon Sep 17 00:00:00 2001 From: wang177777 <132152013+wang177777@users.noreply.github.com> Date: Fri, 24 Jul 2026 16:01:42 +0800 Subject: [PATCH 1/3] Trigger PR literature harvest run --- jama_trigger_pr.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 jama_trigger_pr.txt diff --git a/jama_trigger_pr.txt b/jama_trigger_pr.txt new file mode 100644 index 0000000..0fc8549 --- /dev/null +++ b/jama_trigger_pr.txt @@ -0,0 +1 @@ +triggered_at_utc=2026-07-24T08:05:00Z From aac9ab8c4a4f4cc3dcd73a3b348a4b69aedc277f Mon Sep 17 00:00:00 2001 From: wang177777 <132152013+wang177777@users.noreply.github.com> Date: Fri, 24 Jul 2026 16:04:52 +0800 Subject: [PATCH 2/3] Re-run JAMA harvest with preserved logs --- jama_trigger_pr.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jama_trigger_pr.txt b/jama_trigger_pr.txt index 0fc8549..ebc2c43 100644 --- a/jama_trigger_pr.txt +++ b/jama_trigger_pr.txt @@ -1 +1,2 @@ -triggered_at_utc=2026-07-24T08:05:00Z +triggered_at_utc=2026-07-24T08:12:00Z +attempt=2 From 132ed8dcc4a6e4feb87ef666952d7952be6bd5e3 Mon Sep 17 00:00:00 2001 From: wang177777 <132152013+wang177777@users.noreply.github.com> Date: Fri, 24 Jul 2026 16:05:23 +0800 Subject: [PATCH 3/3] Preserve harvest diagnostics in PR run --- .../workflows/jama_network_open_harvest.yml | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/jama_network_open_harvest.yml b/.github/workflows/jama_network_open_harvest.yml index 390c52d..91bfbbb 100644 --- a/.github/workflows/jama_network_open_harvest.yml +++ b/.github/workflows/jama_network_open_harvest.yml @@ -36,41 +36,49 @@ jobs: run: python -m pip install --disable-pip-version-check requests beautifulsoup4 lxml - name: Harvest and reconcile records - run: python scripts/fetch_jama_network_open.py + id: harvest + shell: bash + run: | + mkdir -p "$OUT_DIR" + set +e + python scripts/fetch_jama_network_open.py > "$OUT_DIR/run.log" 2>&1 + code=$? + echo "exit_code=$code" >> "$GITHUB_OUTPUT" + cat "$OUT_DIR/run.log" + exit 0 - name: Write run metadata + if: always() shell: bash run: | python - <<'PY' import json, os from pathlib import Path out = Path(os.environ['OUT_DIR']) - summary = json.loads((out / 'summary.json').read_text(encoding='utf-8')) + summary_path = out / 'summary.json' + summary = json.loads(summary_path.read_text(encoding='utf-8')) if summary_path.exists() else {} payload = { 'run_id': int(os.environ['GITHUB_RUN_ID']), 'run_attempt': int(os.environ['GITHUB_RUN_ATTEMPT']), 'commit_sha': os.environ['GITHUB_SHA'], 'artifact_name': 'jama-network-open-six-month-literature', + 'harvest_exit_code': '${{ steps.harvest.outputs.exit_code }}', 'summary': summary, } (out / 'latest_run.json').write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding='utf-8') PY - name: Upload complete data artifact + if: always() uses: actions/upload-artifact@v4 with: name: jama-network-open-six-month-literature - path: | - jama_output/research_papers.csv - jama_output/all_records.csv - jama_output/summary.json - jama_output/preview_25.csv - jama_output/latest_run.json + path: jama_output/** if-no-files-found: error retention-days: 7 - name: Publish run pointer and preview - if: github.event_name == 'push' + if: github.event_name == 'push' && steps.harvest.outputs.exit_code == '0' shell: bash run: | git config user.name 'github-actions[bot]' @@ -80,3 +88,7 @@ jobs: git commit -m 'Update JAMA Network Open harvest summary' git push fi + + - name: Fail workflow when harvest failed + if: steps.harvest.outputs.exit_code != '0' + run: exit 1