Implementation:Testtimescaling Testtimescaling github io Git Commit Push Workflow
| 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:
- Configure git -- Sets the bot identity (
github-actions[bot]) and configures the remote URL with anx-access-tokenfor authentication. - Update citation counts -- Runs the Python script that fetches citations and generates the badge JSON.
- Commit and push -- Stages the
arxiv_citations.jsonfile, 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_TOKENsecret (automatically provided by GitHub Actions). - The
update_arxiv_citations.pyscript 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
- Principle:Testtimescaling_Testtimescaling_github_io_Automated_Git_Commit
- Environment:Testtimescaling_Testtimescaling_github_io_GitHub_Actions_Runner
- Heuristic:Testtimescaling_Testtimescaling_github_io_Skip_CI_Commit_Tag
- Heuristic:Testtimescaling_Testtimescaling_github_io_Persist_Credentials_False
- Implementation:Testtimescaling_Testtimescaling_github_io_Actions_Checkout_V3 -- The checkout step that creates the working directory (with
persist-credentials: false, requiring explicit auth here) - Implementation:Testtimescaling_Testtimescaling_github_io_Json_Dump_Shields_Badge -- Generates the
arxiv_citations.jsonfile that gets committed - Implementation:Testtimescaling_Testtimescaling_github_io_GitHub_Actions_Cron_Schedule -- The trigger;
[skip ci]prevents re-triggering