Skip to content

Daily Contributor Sync #26

Daily Contributor Sync

Daily Contributor Sync #26

name: Daily Contributor Sync
on:
schedule:
# Run daily at 6 AM UTC
- cron: '0 6 * * *'
workflow_dispatch:
# Allow manual triggering
jobs:
sync-contributors:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run contributor sync
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run sync-contributors
- name: Commit and push changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add data/contributors.json
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update contributor data [automated]"
git push
fi