Workflow:Testtimescaling Testtimescaling github io Automated Citation Tracking
| Knowledge Sources | |
|---|---|
| Domains | CI_CD, Automation, Academic_Tooling |
| Last Updated | 2025-04-13 00:00 GMT |
Overview
End-to-end automated pipeline for fetching arXiv paper citation counts via the Semantic Scholar API and displaying them as a dynamic Shields.io badge on the repository.
Description
This workflow automates the tracking and display of citation counts for the survey paper associated with this repository. A GitHub Actions cron job runs daily, executing a Python script that queries the Semantic Scholar API for each tracked arXiv paper ID. The script aggregates total citations and writes a Shields.io-compatible JSON file to the repository. The workflow then commits and pushes the updated badge data, which is rendered as a live badge in the README via the Shields.io endpoint service.
Goal: A continuously updated citation count badge displayed in the repository README.
Scope: From configured paper IDs in a JSON file through API query, badge generation, and automated commit.
Strategy: Uses a scheduled GitHub Actions workflow with a lightweight Python script and the Shields.io endpoint badge format for zero-maintenance display.
Usage
Execute this workflow when you want to automatically track and display citation counts for arXiv papers listed in the repository. It runs automatically via daily cron schedule but can also be triggered manually via workflow_dispatch. Use this when maintaining an academic project page that needs to show up-to-date citation metrics without manual intervention.
Execution Steps
Step 1: Scheduled Trigger
The GitHub Actions workflow fires on a daily cron schedule (midnight UTC) or via manual dispatch. The scheduler ensures citation counts are refreshed every 24 hours without human intervention.
Key considerations:
- The cron expression
0 0 * * *runs at midnight UTC daily - Manual trigger via workflow_dispatch is available for on-demand updates
- The workflow requires
contents: writepermission to commit changes
Step 2: Repository Checkout
The workflow checks out the repository code so the Python script can access the paper configuration files and write output to the working directory.
Key considerations:
- Uses
persist-credentials: falsefor security - Git remote URL is reconfigured with GITHUB_TOKEN for authenticated push
- Bot identity is configured for the commit author
Step 3: Fetch Citation Counts
The Python script reads the list of arXiv paper IDs and queries the Semantic Scholar API for each paper's citation count. It accumulates the total citation count across all tracked papers.
Key considerations:
- Uses the Semantic Scholar Graph API endpoint with the
citationCountfield - Handles API failures gracefully by returning 0 for unreachable papers
- Supports multiple arXiv IDs for aggregate citation tracking
Step 4: Generate Badge JSON
The script produces a JSON file conforming to the Shields.io endpoint badge schema. This file contains the schema version, label text, citation count message, and badge color.
Pseudocode:
Read arXiv IDs from configuration For each ID, query Semantic Scholar API Sum all citation counts Write JSON with schemaVersion, label, message, color
Step 5: Commit and Push
The workflow stages the updated badge JSON file, creates a commit with the [skip ci] tag to prevent recursive workflow triggers, and pushes the changes back to the current branch.
Key considerations:
- The commit message includes
[skip ci]to avoid triggering other workflows - Uses conditional commit (exits gracefully if no changes)
- Pushes to the same branch ref that triggered the workflow