anmol098 / waka-readme-stats

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

Waka Readme Stats Failing to uplaod to github #231

Closed nick22985 closed 2 years ago

nick22985 commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Run Waka readme stats in github actions
  2. See error
/usr/bin/docker run --name e1cc515d5196c8f6b349bba55b9c404cd5b18b_d75448 --label e1cc51 --workdir /github/workspace --rm -e INPUT_WAKATIME_API_KEY -e INPUT_GH_TOKEN -e INPUT_COMMIT_BY_ME -e INPUT_SHOW_LINES_OF_CODE -e INPUT_SHOW_PROFILE_VIEWS -e INPUT_SHOW_COMMIT -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_EDITORS -e INPUT_SHOW_LANGUAGE_PER_REPO -e INPUT_SHOW_SHORT_INFO -e INPUT_SHOW_LOC_CHART -e INPUT_LOCALE -e INPUT_IGNORED_REPOS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_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_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_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/WakaTimeStatsUpdate/WakaTimeStatsUpdate":"/github/workspace" e1cc51:5d5196c8f6b349bba55b9c404cd5b18b
npm WARN npm npm does not support Node.js v15.14.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN npm npm does not support Node.js v15.14.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
Traceback (most recent call last):
Username nick22985
  File "/main.py", line 521, in <module>
    repo.update_file(path=contents.path, message='Updated with Dev Metrics',
  File "/usr/local/lib/python3.8/site-packages/github/Repository.py", line 2121, in update_file
    headers, data = self._requester.requestJsonAndCheck(
  File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 315, in requestJsonAndCheck
    return self.__check(
  File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 340, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 422 {"message": "Validation Failed", "errors": [{"resource": "committer", "code": "missing_field", "field": "email"}], "documentation_url": "https://docs.github.com/rest/reference/repos#create-or-update-file-contents"}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/main.py", line 525, in <module>
    repo.update_file(path=contents.path, message='Updated with Dev Metrics',
  File "/usr/local/lib/python3.8/site-packages/github/Repository.py", line 2121, in update_file
    headers, data = self._requester.requestJsonAndCheck(
  File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 315, in requestJsonAndCheck
    return self.__check(
  File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 340, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 422 {"message": "Validation Failed", "errors": [{"resource": "committer", "code": "missing_field", "field": "email"}], "documentation_url": "https://docs.github.com/rest/reference/repos#create-or-update-file-contents"}
Exception Occurred 422 {"message": "Validation Failed", "errors": [{"resource": "committer", "code": "missing_field", "field": "email"}], "documentation_url": "https://docs.github.com/rest/reference/repos#create-or-update-file-contents"}

Expected behavior To run and update github readme

Github repository link n/a just a workflow file


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 }}
          COMMIT_BY_ME: true
          SHOW_LINES_OF_CODE: true
          SHOW_PROFILE_VIEWS: false
          SHOW_COMMIT: true
          SHOW_DAYS_OF_WEEK: true
          SHOW_LANGUAGE: true
          SHOW_OS: true
          SHOW_PROJECTS: false
          SHOW_TIMEZONE: true
          SHOW_EDITORS: true
          SHOW_LANGUAGE_PER_REPO: true
          SHOW_SHORT_INFO: true
          SHOW_LOC_CHART: true

Additional context This was working and sudenly has stopped working in the last few days. Checked github deve key / updated it still producing same error

DionneNoellaBarretto commented 3 years ago

+ 1

Running into run time errors causing line 515 to never execute because of the exception "Cannot find the Locale choosing default to english" match resulting in waka stats not updating in user's readme file.. Seems like a widespread user problem..

Wasn't able to follow through entirely but I wonder if some recent commits in https://github.com/PyGithub/PyGithub/commits/master repo caused this problem.. ?

Run Time Build Error: `/usr/bin/docker run --name f8842045d1aeaba05d43d99d460f8304578bf5_f6bf07 --label f88420 --workdir /github/workspace --rm -e INPUT_WAKATIME_API_KEY -e INPUT_GH_TOKEN -e INPUT_SHOW_LINES_OF_CODE -e INPUT_SHOW_TIMEZONE -e INPUT_SHOW_EDITORS -e INPUT_SHOW_LANGUAGE_PER_REPO -e INPUT_SHOW_OS -e INPUT_SHOW_PROJECTS -e INPUT_SHOW_COMMIT -e INPUT_SHOW_DAYS_OF_WEEK -e INPUT_SHOW_LOC_CHART -e INPUT_SHOW_LANGUAGE -e INPUT_LOCALE -e INPUT_COMMIT_BY_ME -e INPUT_SHOW_PROFILE_VIEWS -e INPUT_SHOW_SHORT_INFO -e INPUT_IGNORED_REPOS -e INPUT_COMMIT_MESSAGE -e INPUT_SHOW_UPDATED_DATE -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_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_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_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/dionnenoellabarretto/dionnenoellabarretto":"/github/workspace" f88420:45d1aeaba05d43d99d460f8304578bf5 Traceback (most recent call last): File "/main.py", line 525, in repo.update_file(path=contents.path, message=commit_message, File "/usr/local/lib/python3.8/site-packages/github/Repository.py", line 2121, in update_file headers, data = self._requester.requestJsonAndCheck( File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 315, in requestJsonAndCheck return self.check( File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 340, in check raise self.__createException(status, responseHeaders, output) github.GithubException.GithubException: 422 {"message": "Validation Failed", "errors": [{"resource": "committer", "code": "missing_field", "field": "email"}], "documentation_url": "https://docs.github.com/rest/reference/repos#create-or-update-file-contents"}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/main.py", line 529, in repo.update_file(path=contents.path, message=commit_message, File "/usr/local/lib/python3.8/site-packages/github/Repository.py", line 2121, in update_file headers, data = self._requester.requestJsonAndCheck( File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 315, in requestJsonAndCheck return self.check( File "/usr/local/lib/python3.8/site-packages/github/Requester.py", line 340, in check raise self.__createException(status, responseHeaders, output) github.GithubException.GithubException: 422 {"message": "Validation Failed", "errors": [{"resource": "committer", "code": "missing_field", "field": "email"}], "documentation_url": "https://docs.github.com/rest/reference/repos#create-or-update-file-contents"} Username DionneNoellaBarretto Cannot find the Locale choosing default to english Exception Occurred 422 {"message": "Validation Failed", "errors": [{"resource": "committer", "code": "missing_field", "field": "email"}], "documentation_url": "https://docs.github.com/rest/reference/repos#create-or-update-file-contents"}`

anmol098 commented 2 years ago

fixed in #241