Daily Disk Digest #124
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: Daily Disk Digest | |
| on: | |
| schedule: | |
| # Runs at 12:00 UTC (8am ET) every weekday — after arXiv's ~00:00 UTC daily announcement. | |
| # Note: GitHub scheduled workflows can be delayed by 15-60 minutes at busy times. | |
| # Adjust the time to suit your timezone. Uses standard cron syntax: | |
| # ┌─ minute (0-59) | |
| # │ ┌─ hour in UTC (0-23) | |
| # │ │ ┌─ day of month (1-31) | |
| # │ │ │ ┌─ month (1-12) | |
| # │ │ │ │ ┌─ day of week (0=Sun, 1=Mon ... 5=Fri) | |
| # │ │ │ │ │ | |
| - cron: "0 12 * * 1-5" | |
| workflow_dispatch: # Also allows manual runs from the GitHub Actions tab | |
| inputs: | |
| debug_fetch: | |
| description: "Diagnostic only: fetch arxiv.org/list/astro-ph/new and print status/length instead of running the digest" | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: write # to commit posted-ids.json back after each run | |
| jobs: | |
| digest: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v5 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Debug arXiv fetch | |
| if: ${{ inputs.debug_fetch }} | |
| run: | | |
| node -e ' | |
| fetch("https://arxiv.org/list/astro-ph/new").then(async res => { | |
| console.log("status:", res.status); | |
| for (const [k, v] of res.headers.entries()) console.log(k + ":", v); | |
| const html = await res.text(); | |
| console.log("html length:", html.length); | |
| const now = new Date(); | |
| const MONTHS = ["January","February","March","April","May","June","July","August","September","October","November","December"]; | |
| const todayStr = `${now.getUTCDate()} ${MONTHS[now.getUTCMonth()]} ${now.getUTCFullYear()}`; | |
| console.log("todayStr:", todayStr, "included:", html.includes(todayStr)); | |
| const newSection = html.split(/Replacement submissions/i)[0]; | |
| console.log("newSection length:", newSection.length); | |
| const ids = [...new Set([...newSection.matchAll(/arXiv:(\d{4}\.\d{4,5})/g)].map(m => m[1]))]; | |
| console.log("ids found:", ids.length); | |
| const h3 = [...html.matchAll(/<h3>([^<]*)<\/h3>/g)].map(m => m[1]); | |
| console.log("h3 headings:", JSON.stringify(h3)); | |
| console.log("--- first 500 chars ---"); | |
| console.log(html.slice(0, 500)); | |
| }).catch(err => { console.error("fetch failed:", err); process.exit(1); }); | |
| ' | |
| - name: Run Disk Digest | |
| if: ${{ !inputs.debug_fetch }} | |
| env: | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
| SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} | |
| PARLEY_API_KEY: ${{ secrets.PARLEY_API_KEY }} | |
| PARLEY_BASE_URL: ${{ secrets.PARLEY_BASE_URL }} | |
| run: node disk-digest.js | |
| # Persist the record of already-digested papers so later runs skip them | |
| - name: Commit posted-ids.json | |
| if: ${{ !inputs.debug_fetch }} | |
| run: | | |
| test -f posted-ids.json || exit 0 | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add posted-ids.json | |
| git diff --staged --quiet && exit 0 | |
| git commit -m "Record digested paper IDs" | |
| git pull --rebase origin ${{ github.ref_name }} | |
| git push |