flowwer-dev / pull-request-stats

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

Unable to see users and data after successful run of action #19

Closed pantheman1 closed 2 years ago

pantheman1 commented 2 years ago

Hello,

I have implemented this Github action but it doesn't appear to access any of the user or PR data in the repos. Can you help me understand what might be wrong? Here is the code:

---
name: Pull Request Stats

on: pull_request

jobs:
  stats:
    runs-on: ubuntu-latest
    steps:
      - name: Run pull request stats
        uses: flowwer-dev/pull-request-stats@master
        with:
          token: ${{ secrets.PR_REPORT_GITHUB_PERSONAL_ACCESS_TOKEN }}
          organization: 'Vivpro'
          period: 30
          charts: true
          disable-links: true
          sort-by: 'TIME'
          limit: 0

The job runs successfully. Here is the output I see in the description: image

For some added information, I created a new repo where this workflow lives.

Inside the with, I also tried adding repositories: comma separated list of our repositories but that hasn't worked either.

Thanks so much in advance for helping!

manuelmhtr commented 2 years ago

Hi @pantheman1 sorry for the late reply.

It seems the token has the right access, otherwise you would get an error.

Is it possible that you don't have any pull request during the last 30 days? Maybe could you try with a longer time (eg. period: 365) to see it that works.

LAlexMI commented 2 years ago

Hi, I'm facing the same issue.

name: Pull Request Stats

on: pull_request

jobs:
  stats:
    runs-on: ubuntu-latest
    steps:
      - name: Run pull request stats
        uses: flowwer-dev/pull-request-stats@v2
        with:
          token: {{ secrets.PR_REPORT_GITHUB_PERSONAL_ACCESS_TOKEN }}
          repositories: {{ repo }}
          period: 7
          charts: true
          sort-by: 'COMMENTS'

I definitely have open PRs in the last 7 days. Even today new PRs were created. I have the same setup as @pantheman1. I set up a new repo to maintain the workflow and want to monitor another repo that I defined in the repositories field.

Results of the execution

Run flowwer-dev/pull-request-stats@v2
  with:
    token: ***
    repositories: {{ repo }}
    period: 7
    charts: true
    sort-by: COMMENTS
    disable-links: false
    limit: 0
Found 0 pull requests to analyze
Analyzed stats for 0 pull request reviewers
Action successfully executed
pantheman1 commented 2 years ago

@manuelmhtr Thanks for your response and thanks @LAlexMI for confirming. My repo is pretty active so I can confirm we have PRs.

LAlexMI commented 2 years ago

My AccessToken was not authorized to use SSO. Which is required for our company. After I authorized the token to use SSO it works

manuelmhtr commented 2 years ago

@pantheman1 could you try with Alex's solution? If that works, I'll add it to a Troubleshooting section.