flowwer-dev / pull-request-stats

Github action to print relevant stats about Pull Request reviewers
MIT License
359 stars 79 forks source link

Error only when Scheduled run: Cannot read property 'full_name' of undefined #44

Closed pattwell closed 2 years ago

pattwell commented 2 years ago

Hello, I am not sure this isn't just me doing something wrong, but I get the following error only when the action is not triggered manually: Cannot read property 'full_name' of undefined

Screenshot 2022-08-01 at 11 34 52

The code is as below:

on:
  workflow_dispatch:
  schedule:
    - cron:  '0 7 * * 1' # Weekly on Mondays at 7am

jobs:
  stats:
    name: Send PR Stats to Slack
    runs-on: ubuntu-latest
    steps:
      - name: Backend Stats
        uses: flowwer-dev/pull-request-stats@master
        with:
          repositories: <redacted>
          limit: 10
          token: ${{ secrets.REVIEW_BOT_READONLY_PAT }}
          slack-webhook: ${{ secrets.PR_STATS_SLACK_WEBHOOK_URL }}
          slack-channel: '<redacted>'

When I run it manually it works, so this error only comes up when it is running based on the cron. I'm not sure if it's something to do with it not having the right context of the current repo perhaps?

Any advice appreciated :)

manuelmhtr commented 2 years ago

Hi @pattwell! I found the problem. You are right, it's about a missing property in the context. I couldn't send the fix today but I hope to do it in the next couple of days. I'll keep you updated :)

manuelmhtr commented 2 years ago

Hi @pattwell, it should be fixed in v2.4.3. Honestly I didn't have the time to test it properly, but according to Github docs it should work. I'll finish with testing tomorrow but I preferred to tell you in advance.

pattwell commented 2 years ago

@manuelmhtr That's awesome, thanks so much for the super quick response!

pattwell commented 2 years ago

@manuelmhtr Confirmed on my side that it's working on the schedule now! I will close this issue now since it is fixed, hope that is alright. Thank you so much 😄