Update README #63
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: Update README | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # once a day | |
| workflow_dispatch: | |
| jobs: | |
| update-readme: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # π allow pushing commits | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get Repo Count | |
| id: repo_count | |
| run: | | |
| echo "COUNT=$(curl -s https://api.github.com/users/mohdjariullah | jq '.public_repos')" >> $GITHUB_ENV | |
| - name: Update README | |
| run: | | |
| sed -i "s/\(created: \)[0-9]\+/\1$COUNT/" README.md | |
| - name: Commit & Push | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add README.md | |
| git commit -m "π Update repo count to $COUNT" || echo "No changes to commit" | |
| git push | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |