Skip to content

♟️ Automatically update your README.md with Chess.com games and stats - fully customizable

License

Notifications You must be signed in to change notification settings

Balastrong/chess-stats-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Chess Stats Action

Automatically add and keep up to date your latest games from chess.com.

Type Rapid ⏲️ Blitz ⚡ Bullet 🔫
Current 2805 3207 3300
Best 2927 3332 3570
White ⚪ Black ⚫ Result 🏆 Date 📅 Position 🗺️
Mykola-Bortnyk Hikaru win 🥇 28/7/2022 Link
Hikaru Mykola-Bortnyk win 🥇 28/7/2022 Link
Mykola-Bortnyk Hikaru win 🥇 28/7/2022 Link
Hikaru Mykola-Bortnyk repetition ⏸️ 28/7/2022 Link
NikoTheodorou Hikaru win 🥇 27/7/2022 Link
Hikaru NikoTheodorou win 🥇 27/7/2022 Link
NikoTheodorou Hikaru repetition ⏸️ 27/7/2022 Link
smallxhafa Hikaru repetition ⏸️ 27/7/2022 Link
Knukleks Hikaru win 🥇 27/7/2022 Link
blyp Hikaru win 🥇 27/7/2022 Link

Usage

Add these two placeholders somewhere in your README.md, they will get replaced by the action.

<!--START_SECTION:chessStats-->

<!--END_SECTION:chessStats-->

Create a GitHub Action in your repository, you can call it chess-stats-action.yml.

name: Chess Games & Stats Action

on:
  schedule:
    - cron: '0 0 * * *' # Runs at 00:00 UTC every day
  workflow_dispatch:

jobs:
  update-readme:
    name: Update readme with your chess stats and games
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v3
      - uses: Balastrong/chess-stats-action@main
        with:
          CHESS_USERNAME: <Your chess.com Username>

Configuration

There are a few configuration options you can use in your GitHub Action.

Parameter Description Default Required
CHESS_USERNAME Your chess.com username hikaru Yes
COMMIT_EMAIL Commit email used while committing to the repo 41898282+github-actions[bot]@users.noreply.github.com No
COMMIT_MSG Commit message used while committing to the repo ♟️ Updated README with your chess games No
COMMIT_USERNAME Commit username used while committing to the repo chess-stats-bot No
GAMES_SIZE How many games to load 10 No
SHOW_DATE Toggle the Date column true No
SHOW_FEN Toggle the Position column true No
FILE_NAME Define a specific file in your repo README.md No
SHOW_STATS Show stats true No
SHOW_TIME_CLASS Toggle the game type column true No

Contributing

There are many possible ways to expand the functionalities or improve the current logic. Feel free to have a look at the open issues or create a new one youself if something is missing.

PRs are also welcome!

More details on how to setup and contribute in CONTRIBUTING.md