Skip to content

Update GitHub Stars

Update GitHub Stars #5

Workflow file for this run

name: Update GitHub Stars
on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC
workflow_dispatch:
inputs:
python-version:
description: 'Python version to use'
required: false
default: '3.13.2'
type: choice
options:
- '3.13.2'
- '3.13.1'
- '3.13.0'
- '3.12'
- '3.11'
- '3.10'
- '3.9'
dry-run:
description: 'Run without committing changes'
required: false
default: false
type: boolean
jobs:
update-stars:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version || '3.13.2' }}
allow-prereleases: true
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Cache uv dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/uv
~/.cache/pip
.venv
key: ${{ runner.os }}-uv-${{ inputs.python-version || '3.13.2' }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}
restore-keys: |
${{ runner.os }}-uv-${{ inputs.python-version || '3.13.2' }}-
${{ runner.os }}-uv-
- name: Setup environment
run: |
uv venv
uv pip install --upgrade pip
uv add .
uv sync
- name: Update star counts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make update-stars
- name: Commit and push if changed
if: ${{ !inputs.dry-run }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add table.csv README.md
git diff --quiet && git diff --staged --quiet || (git commit -m "Update GitHub star counts" && git push)