Skip to content

Cleanup Old Repository Data #16

Cleanup Old Repository Data

Cleanup Old Repository Data #16

Workflow file for this run

name: Cleanup Old Repository Data
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * 0' # Weekly on Sunday at 2:00 AM UTC
permissions:
contents: write
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run cleanup script
run: python scripts/cleanup_old_repos.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
- name: Commit cleaned data
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add _data/trending_checked.yml
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: cleanup old repository data"
git push
fi