Skip to content

Commit d4af4cc

Browse files
committed
Add temporary workflow_dispatch debug mode for arXiv fetch diagnosis
Recent runs report 0 papers despite historical volume of 70-150/day. This adds an opt-in diagnostic step to inspect what the GitHub Actions runner actually receives from arxiv.org, without touching digest logic.
1 parent 382e513 commit d4af4cc

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/daily-digest.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
# │ │ │ │ │
1414
- cron: "0 12 * * 1-5"
1515
workflow_dispatch: # Also allows manual runs from the GitHub Actions tab
16+
inputs:
17+
debug_fetch:
18+
description: "Diagnostic only: fetch arxiv.org/list/astro-ph/new and print status/length instead of running the digest"
19+
type: boolean
20+
default: false
1621

1722
permissions:
1823
contents: write # to commit posted-ids.json back after each run
@@ -34,7 +39,32 @@ jobs:
3439
- name: Install dependencies
3540
run: npm ci
3641

42+
- name: Debug arXiv fetch
43+
if: ${{ inputs.debug_fetch }}
44+
run: |
45+
node -e '
46+
fetch("https://arxiv.org/list/astro-ph/new").then(async res => {
47+
console.log("status:", res.status);
48+
for (const [k, v] of res.headers.entries()) console.log(k + ":", v);
49+
const html = await res.text();
50+
console.log("html length:", html.length);
51+
const now = new Date();
52+
const MONTHS = ["January","February","March","April","May","June","July","August","September","October","November","December"];
53+
const todayStr = `${now.getUTCDate()} ${MONTHS[now.getUTCMonth()]} ${now.getUTCFullYear()}`;
54+
console.log("todayStr:", todayStr, "included:", html.includes(todayStr));
55+
const newSection = html.split(/Replacement submissions/i)[0];
56+
console.log("newSection length:", newSection.length);
57+
const ids = [...new Set([...newSection.matchAll(/arXiv:(\d{4}\.\d{4,5})/g)].map(m => m[1]))];
58+
console.log("ids found:", ids.length);
59+
const h3 = [...html.matchAll(/<h3>([^<]*)<\/h3>/g)].map(m => m[1]);
60+
console.log("h3 headings:", JSON.stringify(h3));
61+
console.log("--- first 500 chars ---");
62+
console.log(html.slice(0, 500));
63+
}).catch(err => { console.error("fetch failed:", err); process.exit(1); });
64+
'
65+
3766
- name: Run Disk Digest
67+
if: ${{ !inputs.debug_fetch }}
3868
env:
3969
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
4070
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
@@ -44,6 +74,7 @@ jobs:
4474

4575
# Persist the record of already-digested papers so later runs skip them
4676
- name: Commit posted-ids.json
77+
if: ${{ !inputs.debug_fetch }}
4778
run: |
4879
test -f posted-ids.json || exit 0
4980
git config user.name "github-actions[bot]"

0 commit comments

Comments
 (0)