anmol098 / waka-readme-stats

This GitHub action helps to add cool dev metrics to your github profile Readme
MIT License
3.36k stars 549 forks source link

Can not run work flow #484

Closed FreddieGeorge closed 12 months ago

FreddieGeorge commented 12 months ago

Describe the bug I could run workflow normally before, but I was informed by email 2 days ago that it could not be used normally. The TIME_RANGE(which used to work) was removed when I saw an Unexpected input error. But it's not working yet. This is a further error message. 1700535769903

work flow code:

name: Waka Readme

on:
  workflow_dispatch: # for manual workflow trigger
  schedule:
    - cron: "0 0 * * *" # runs at every 12AM UTC

jobs:
  update-readme:
    name: WakaReadme DevMetrics
    runs-on: ubuntu-latest
    steps:
      - uses: anmol098/waka-readme-stats@master
        with:
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
          # TIME_RANGE: last_30_days
          SHOW_LINES_OF_CODE: "True"
          SHOW_PROFILE_VIEWS: "False"
          SHOW_COMMIT: "False"
          SHOW_EDITORS: "False"
          SHOW_DAYS_OF_WEEK: "False"
          SHOW_LANGUAGE: "True"
          SHOW_OS: "True"
          SHOW_PROJECTS: "False"
          SHOW_TIMEZONE: "False"
          SHOW_LANGUAGE_PER_REPO: "False"
          SHOW_SHORT_INFO: "False"
          SHOW_LOC_CHART: "False"
          SYMBOL_VERSION: 2

          # following flags are required, only if this is not on
          # profile readme, remove the leading `#` to use them
          #GH_TOKEN: ${{ secrets.GH_TOKEN }}
          #REPOSITORY: <gh_username/gh_username>

Expected behavior

/usr/bin/docker run --name wakareadmestatswakareadmestatsmaster_e713c4 --label a693c1 --workdir /github/workspace --rm -e "INPUT_WAKATIME_API_KEY" -e "INPUT_GH_TOKEN" -e "INPUT_SHOW_LINES_OF_CODE" -e "INPUT_SHOW_PROFILE_VIEWS" -e "INPUT_SHOW_COMMIT" -e "INPUT_SHOW_EDITORS" -e "INPUT_SHOW_DAYS_OF_WEEK" -e "INPUT_SHOW_LANGUAGE" -e "INPUT_SHOW_OS" -e "INPUT_SHOW_PROJECTS" -e "INPUT_SHOW_TIMEZONE" -e "INPUT_SHOW_LANGUAGE_PER_REPO" -e "INPUT_SHOW_SHORT_INFO" -e "INPUT_SHOW_LOC_CHART" -e "INPUT_SYMBOL_VERSION" -e "INPUT_SECTION_NAME" -e "INPUT_PULL_BRANCH_NAME" -e "INPUT_PUSH_BRANCH_NAME" -e "INPUT_SHOW_UPDATED_DATE" -e "INPUT_SHOW_TOTAL_CODE_TIME" -e "INPUT_COMMIT_BY_ME" -e "INPUT_COMMIT_MESSAGE" -e "INPUT_COMMIT_USERNAME" -e "INPUT_COMMIT_EMAIL" -e "INPUT_COMMIT_SINGLE" -e "INPUT_LOCALE" -e "INPUT_UPDATED_DATE_FORMAT" -e "INPUT_IGNORED_REPOS" -e "INPUT_DEBUG_LOGGING" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/FreddieGeorge/FreddieGeorge":"/github/workspace" wakareadmestats/waka-readme-stats:master
Traceback (most recent call last):
  File "/waka-readme-stats/main.py", line 221, in <module>
    run(main())
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 208, in main
    stats = await get_stats()
            ^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 163, in get_stats
    data = await DM.get_remote_json("waka_all")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/manager_download.py", line 202, in get_remote_json
    return await DownloadManager._get_remote_resource(resource, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/manager_download.py", line 193, in _get_remote_resource
    raise Exception(f"Query '{res.url}' failed to run by returning code of {res.status_code}: {res.json()}")
Exception: Query 'https://wakatime.com/api/v1/users/current/all_time_since_today?api_key=***' failed to run by returning code of 202: {'data': {'is_up_to_date': False, 'range': {'start': '2022-02-15T16:00:00Z', 'start_date': '2022-02-16', 'start_text': 'Wed Feb 16th 2022', 'end': '2023-11-21T15:59:59Z', 'end_date': '2023-11-21', 'end_text': 'Today', 'timezone': 'Asia/Shanghai'}, 'timeout': 15, 'percent_calculated': 99, 'total_seconds': 4735734.475525, 'text': '1,315 hrs [28](https://github.com/FreddieGeorge/FreddieGeorge/actions/runs/6938613396/job/18874615893#step:3:29) mins', 'decimal': '1[31](https://github.com/FreddieGeorge/FreddieGeorge/actions/runs/6938613396/job/18874615893#step:3:32)5.[47](https://github.com/FreddieGeorge/FreddieGeorge/actions/runs/6938613396/job/18874615893#step:3:48)', 'digital': '1315:28'}, 'message': 'Calculating stats for this user. Check back later.'}
sys:1: RuntimeWarning: coroutine 'AsyncClient.get' was never awaited

Github repository link Github repository link.

aberdayy commented 12 months ago

I have the same problem.

JackeyHua-SJTU commented 12 months ago

me too, hope to be fixed soon

v1peridae commented 12 months ago

Same here

Zheng-Yi-git commented 12 months ago

I am having a slightly different exception information, which also starts from today, before that it runs normally. my workflow:

name: Waka Readme

on:
  schedule:
    # Runs at 12am IST
    - cron: '30 18 * * *'
  workflow_dispatch:
jobs:
  update-readme:
    name: Update Readme with Metrics
    runs-on: ubuntu-latest
    steps:
      - uses: anmol098/waka-readme-stats@master
        with:
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
          # 时间线
          SHOW_LOC_CHART: False

exception information:

Traceback (most recent call last):
  File "/waka-readme-stats/main.py", line 221, in <module>
    run(main())
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 208, in main
    stats = await get_stats()
            ^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 180, in get_stats
    stats += await get_waka_time_stats(repositories, commit_data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 49, in get_waka_time_stats
    lang_list = no_activity if len(data["data"]["languages"]) == 0 else make_list(data["data"]["languages"])
                                   ~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'languages'
sys:1: RuntimeWarning: coroutine 'AsyncClient.get' was never awaited
DavianMachete commented 12 months ago

I am having a slightly different exception information, which also starts from today, before that it runs normally. my workflow:

name: Waka Readme

on:
  schedule:
    # Runs at 12am IST
    - cron: '30 18 * * *'
  workflow_dispatch:
jobs:
  update-readme:
    name: Update Readme with Metrics
    runs-on: ubuntu-latest
    steps:
      - uses: anmol098/waka-readme-stats@master
        with:
          WAKATIME_API_KEY: ${{ secrets.WAKATIME_API_KEY }}
          GH_TOKEN: ${{ secrets.GH_TOKEN }}
          # 时间线
          SHOW_LOC_CHART: False

exception information:

Traceback (most recent call last):
  File "/waka-readme-stats/main.py", line 221, in <module>
    run(main())
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 208, in main
    stats = await get_stats()
            ^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 180, in get_stats
    stats += await get_waka_time_stats(repositories, commit_data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 49, in get_waka_time_stats
    lang_list = no_activity if len(data["data"]["languages"]) == 0 else make_list(data["data"]["languages"])
                                   ~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'languages'
sys:1: RuntimeWarning: coroutine 'AsyncClient.get' was never awaited

I have the same error on my side.

anmol098 commented 12 months ago

There seems to be issue with Wakatime API which were giving HTTP status code 202 for some api calls. fix has been added so please re-run the workflow manually to update the data or else the next scheduled workflow run will update the data