Fetch Repositories #7
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: Fetch Repositories | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| fetch-repos: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Fetch and Process Repos | |
| run: | | |
| curl -s -H "Accept: application/vnd.github+json" https://api.github.com/users/facrf/repos?sort=updated\&per_page=100 > raw_repos.json | |
| jq '[.[] | select(.fork == false and .archived == false) | {name: .name, description: .description, language: .language, stargazers_count: .stargazers_count, html_url: .html_url}] | .[0:6]' raw_repos.json > repos-data.json | |
| rm raw_repos.json | |
| - name: Commit and Push | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add repos-data.json | |
| git diff --quiet && git diff --staged --quiet || (git commit -m "chore: update repos-data.json" && git push) |