Update README cards #89
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
| # https://github.com/stats-organization/github-readme-stats-action#quick-start | |
| name: Update README cards | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/readme-stats.yml" | |
| schedule: | |
| - cron: "0 * * * *" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Generate stats card (dormant-user) | |
| uses: stats-organization/github-readme-stats-action@v2 | |
| with: | |
| card: stats | |
| options: ${{ vars.STATS_OPTIONS_DORMANT }} | |
| path: images/stats-dormant.svg | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate stats card (thevickypedia) | |
| uses: stats-organization/github-readme-stats-action@v2 | |
| with: | |
| card: stats | |
| options: ${{ vars.STATS_OPTIONS_THEVICKYPEDIA }} | |
| path: images/stats-thevickypedia.svg | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate top languages card (dormant-user) | |
| uses: stats-organization/github-readme-stats-action@v2 | |
| with: | |
| card: top-langs | |
| options: ${{ vars.TOP_LANGS_OPTIONS_DORMANT }} | |
| path: images/top-langs-dormant.svg | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate top languages card (thevickypedia) | |
| uses: stats-organization/github-readme-stats-action@v2 | |
| with: | |
| card: top-langs | |
| options: ${{ vars.TOP_LANGS_OPTIONS_THEVICKYPEDIA }} | |
| path: images/top-langs-thevickypedia.svg | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Commit cards | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| # Try to delete the remote branch if it exists; ignore failure if it doesn't | |
| git push origin --delete stats || true | |
| # Create or switch to the local 'stats' branch | |
| git checkout -b stats | |
| # Stage and commit changes | |
| git add images/*.svg | |
| git commit -m "Update README cards" || exit 0 | |
| # Push the branch, setting upstream if needed | |
| git push -u origin stats |