Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Testtimescaling Testtimescaling github io Git Commit Push Workflow

From Leeroopedia


Metadata
Page Type Implementation
Implementation Type External Tool Doc
Domain CI_CD, Version_Control
Namespace Testtimescaling_Testtimescaling_github_io
Workflow Automated_Citation_Tracking
Date Created 2026-02-14
Principle Principle:Testtimescaling_Testtimescaling_github_io_Automated_Git_Commit
Knowledge Source GitHub Actions GITHUB_TOKEN

Overview

This implementation configures git identity, sets up token-based authentication, runs the citation update script, and commits/pushes the resulting changes back to the repository.

Description

The final steps of the Automated Citation Tracking workflow handle the end-to-end process of persisting the updated citation data. This includes three workflow steps:

  1. Configure git -- Sets the bot identity (github-actions[bot]) and configures the remote URL with an x-access-token for authentication.
  2. Update citation counts -- Runs the Python script that fetches citations and generates the badge JSON.
  3. Commit and push -- Stages the arxiv_citations.json file, creates a commit with a [skip ci] message to prevent recursive triggers, and pushes to the current branch.

The || echo "No changes to commit" pattern ensures the step does not fail when citation counts have not changed since the last run.

Usage

These steps run at the end of the update-citations job, after the repository has been checked out. They depend on:

  • A valid GITHUB_TOKEN secret (automatically provided by GitHub Actions).
  • The update_arxiv_citations.py script being present in .github/scripts/.
  • The checkout step having completed successfully.

Code Reference

Source Location

File .github/workflows/update_citations.yml
Lines L20-35
Repository testtimescaling.github.io

Signature

      - name: Configure git
        run: |
          git config --global user.email "github-actions[bot]@users.noreply.github.com"
          git config --global user.name "github-actions[bot]"
          git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git

      - name: Update citation counts
        run: |
          python .github/scripts/update_arxiv_citations.py

      - name: Commit and push
        run: |
          git add arxiv_citations.json
          git commit -m "Update arxiv citation counts [skip ci]" || echo "No changes to commit"
          git push origin HEAD:${{ github.ref }}

Import

Not applicable. These are inline shell commands executed in GitHub Actions workflow steps.

Key Parameters

Parameter Value Description
Bot email github-actions[bot]@users.noreply.github.com The email identity used for commits made by the automation bot
Bot name github-actions[bot] The author name that appears in the git commit history
Authentication x-access-token:${{ secrets.GITHUB_TOKEN }} Token-based authentication embedded in the remote URL
Commit message "Update arxiv citation counts [skip ci]" Descriptive message with [skip ci] to prevent recursive workflow triggers
Push target HEAD:${{ github.ref }} Pushes the current HEAD to the branch that triggered the workflow

I/O Contract

Inputs

Input Type Description
arxiv_citations.json Modified file The badge JSON file generated by the update_arxiv_citations.py script in the preceding step
secrets.GITHUB_TOKEN Secret string The automatically generated authentication token provided by GitHub Actions
github.repository Context variable The owner/repo string (e.g., testtimescaling/testtimescaling.github.io)
github.ref Context variable The branch ref that triggered the workflow (e.g., refs/heads/main)

Outputs

Output Type Description
Git commit Repository commit A new commit on the target branch with the updated arxiv_citations.json file (or no commit if unchanged)
Remote push Repository state The commit is pushed to the remote repository, making the updated badge data available via GitHub Pages

Usage Examples

Example 1: Default behavior (changes detected)

When the citation count has changed, the workflow produces output similar to:

[main abc1234] Update arxiv citation counts [skip ci]
 1 file changed, 1 insertion(+), 1 deletion(-)

Example 2: No changes detected

When the citation count is the same as the previous run, the commit step falls through to the echo:

nothing to commit, working tree clean
No changes to commit

The git push command still executes but is a no-op since there is no new commit.

Example 3: Adapting for multiple output files

To commit additional generated files, modify the git add command:

      - name: Commit and push
        run: |
          git add arxiv_citations.json coverage_report.json
          git commit -m "Update generated files [skip ci]" || echo "No changes to commit"
          git push origin HEAD:${{ github.ref }}

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment