jstrieb / github-stats

Better GitHub statistics images for your profile, with stats from private repos too
GNU General Public License v3.0
2.97k stars 626 forks source link

No name's github stats #77

Open reveurguy opened 2 years ago

reveurguy commented 2 years ago

I am trying to implement the stats on readme. I have created all the files and folders and yaml file but I am getting No name's github stats and no stats. I am an attaching the image for reference:

Screenshot 2022-07-06 at 2 58 34 PM

This is my main.yml file:

# This is a basic workflow to help you get started with Actions

name: Generate Stats Images

# Controls when the action will run. Triggers the workflow on push events
on:
  push:
  schedule:
    - cron: "0 0 * * *"
  workflow_dispatch:

permissions:
  contents: write

# A workflow run is made up of one or more jobs that can run sequentially or in
# parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out repository under $GITHUB_WORKSPACE, so the job can access it
    - uses: actions/checkout@v2

    # Run using Python 3.8 for consistency and aiohttp
    - name: Set up Python 3.8
      uses: actions/setup-python@v2
      with:
        python-version: '3.8'
        architecture: 'x64'

    # Cache dependencies. From:
    # https://github.com/actions/cache/blob/master/examples.md#python---pip
    - uses: actions/cache@v2
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
        restore-keys: |
          ${{ runner.os }}-pip-

    # Install dependencies with `pip`
    - name: Install requirements
      run: |
        python3 -m pip install --upgrade pip setuptools wheel
        python3 -m pip install -r requirements.txt

    - name: Generate images
      run: |
        python3 --version
        python3 generate_images.py
      env:
        ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
        GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
        EXCLUDE_FORKED_REPOS: true

    # Commits all changed files to the repository
    - name: Commit to the output branch of repo
      run: |
        git config --global user.name "reveurguy"
        git config --global user.email "reveur.guy99@gmail.com"
        git add .
        git commit -m 'temp commit' || echo
        git checkout output1 2>/dev/null || git checkout --orphan output1 && git rm -rf . && git checkout master -- generated/
        # "echo" returns true so the build succeeds, even if no changed files
        git commit -m 'Update generated files' || echo
        git push origin output1 -f
seanpm2001 commented 2 years ago

I have been running this process for nearly a month. I have noted that it only says No name when it hasn't properly indexed all repositories. It appears to be random, some days it works, some days it doesn't. It will work eventually if you let it run enough times. Although inconvenient, this is what I have observed. The stats should appear when it runs correctly as well. Try running it for 14 days and sample the results.

jstrieb commented 2 years ago

What permissions to you have set on your personal access token?

jmmaa commented 2 years ago

What permissions to you have set on your personal access token?

same issue, I have not set any permissions on my token

iaizawa0623 commented 2 years ago

I think you used "Fine-grained personal access tokens". Try using "personal access tokens (classic)". Don't forget to check repo and user:read permissions.