name: Update README cards on: schedule: - cron: "0 0 * * *" # Runs once daily at midnight workflow_dispatch: jobs: build: runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v7 - name: Check stats token is configured env: GH_STATS_TOKEN: ${{ secrets.GH_STATS_TOKEN }} run: | if [ -z "$GH_STATS_TOKEN" ]; then echo "::error::GH_STATS_TOKEN is not set. Create a PAT with 'repo' and 'read:user' scopes and add it as a repository secret." exit 1 fi - name: Generate stats card uses: stats-organization/github-readme-stats-action@v2 with: card: stats options: username=${{ github.repository_owner }}&show_icons=true&locale=en&theme=dracula&count_private=true path: profile/stats.svg token: ${{ secrets.GH_STATS_TOKEN }} fail_on_error: true - name: Generate top languages card uses: stats-organization/github-readme-stats-action@v2 with: card: top-langs options: username=${{ github.repository_owner }}&layout=compact&langs_count=6 path: profile/top-langs.svg token: ${{ secrets.GH_STATS_TOKEN }} fail_on_error: true - name: Generate streak card run: | curl -sS --fail --retry 5 --retry-all-errors --retry-delay 5 --max-time 90 \ -o streak.svg \ "https://streak-stats.demolab.com/?user=${{ github.repository_owner }}&theme=dracula" grep -q "