Refresh Tiered Repo Catalog #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Refresh Repo Catalog | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 3 * * 1" | |
| permissions: | |
| contents: write | |
| jobs: | |
| refresh: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci --ignore-scripts | |
| - name: Refresh trending repository dataset | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npm run data:refresh:repos | |
| - name: Commit refreshed dataset | |
| run: | | |
| if git diff --quiet -- public/data/top-repos.json; then | |
| echo "No dataset changes detected." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add public/data/top-repos.json | |
| git commit -m "chore(data): refresh trending repo catalog" | |
| git push |