Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
square

GitHub Action

README Profile LoL Stats

v0.1

README Profile LoL Stats

square

README Profile LoL Stats

Generate a widget of your fun LoL Statistics

Installation

Copy and paste the following snippet into your .yml file.

              

- name: README Profile LoL Stats

uses: rithikasilva/[email protected]

Learn more about this action in rithikasilva/readme-lol-stats

Choose a version

Notes

This is still in alpha, so an API key for the Riot API is required for this to work.

Usage

There must be a folder titles readme-lol-items in the repository that you wish to use this action in. Additionally, a file titled config.json with the following contents must exist:

{
    "Summoner Name": "R1tzcrackers",
    "Matches": 10,
    "Target File": "README.md",
    "Toggle Credit": 1,
    "Skin Substitutions": {
        "Yasuo": "Nightbringer Yasuo",
        "Yone": "Dawnbringer Yone",
        "Akali": "K/DA Akali",
        "Taliyah": "Pool Party Taliyah",
        "Katarina": "Battle Queen Katarina"
    },
    "Extra Info": {
        "Seconds of CC": 1,
        "Display Rank": 1,
        "Main Lane": 1,
        "Ability Count": 1,
        "Solokills": 1,
        "Takedowns": 1,
        "Mastery": 1,
        "K/D/A": 1,
        "Pentakills": 1,
        "Quadrakills": 1,
        "Triplekills": 1,
        "Doublekills": 1
    }
} 

The "Skin Substitutions" section allows you to specify a champion and your preferred skin to display with that champion.

The "Extra Info" section allows you to toggle what is being show. A "1" is used when you want it to display, and a "0" is used when you don't want it to display.

In your README.md file you want to place the following code without the curly braces:

{<!---LOL-STATS-START-HERE--->}
{<!---LOL-STATS-END-HERE--->}

This dictates where the generated statistics will be displayed.

This following code allows you to run the project manually. You can schedule using cron if you want to automate it. Ensure to have a secret named "API_KEY" with the Riot API key for this action to work. Additionally, the code must be placed in the .github/workflows directory of the repository. Note that you may replace @0.1 with a release number of your choice for each successive version of the project.

name: Run readme-lol-stats

on:    
    workflow_dispatch:

jobs:
    build:    
        runs-on: ubuntu-latest
        steps:
            # Checkout current repo to runner
          - name: Checkout current repo
            uses: actions/checkout@v2 
            
            # Setup python
          - name: setup python
            uses: actions/setup-python@v4
            with:
                python-version: '3.9' 
        
            # Upgrade pip
          - name: Upgrade Pip
            run: |
                python -m pip install --upgrade pip
            
            # Run readme-lol-stats-action
          - name: Use readme-lol-stats-action
            uses: rithikasilva/[email protected] 
            with:
                source: ${{ github.event.repository.name }}
                api-key: ${{ secrets.API_KEY }}
            
            # Commit files to current repo
          - name: commit files
            run: |
                git config --local user.email "[email protected]"
                git config --local user.name "GitHub Action"
                git add -A
                git diff-index --quiet HEAD || (git commit -a -m "updated logs" --allow-empty)
            
            # Push changes to current repo
          - name: push changes
            uses: ad-m/[email protected]
            with:
                github_token: ${{ secrets.GITHUB_TOKEN }}
                branch: main 

Example Layout

Here is an example layout:

Data from Last 10 Matches for R1tzcrackers

Top 5 Recently Played Champions
-------------------------
drawing Akali            |███████████--------------|  40.00%
drawing Taliyah          |██████-------------------|  20.00%
drawing Neeko            |███----------------------|  10.00%
drawing Katarina         |███----------------------|  10.00%
drawing Quinn            |███----------------------|  10.00%
-------------------------
Seconds CCing Enemies: 121
Current Rank: Silver drawing
Most Played Position: Middle drawing
Total Abilities Used: 1856
Total Solokills: 19
Total Takedowns: 91
KDA: 41/58/50
Pentakills: 0
Quadrakills: 0
Triplekills: 0
Doublekills: 4
Top 3 Champion Masteries
------------------------
drawing Neeko: 136368 
drawing Yone: 108926 
drawing Akali: 90335 

README Profile LoL Stats isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.