Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API rate limit exceeded - is this action doing too much? #108

Closed
teebu opened this issue Oct 7, 2021 · 3 comments
Closed

API rate limit exceeded - is this action doing too much? #108

teebu opened this issue Oct 7, 2021 · 3 comments

Comments

@teebu
Copy link

teebu commented Oct 7, 2021

We have a mono repo and we use this action to see if we need to run specific tasks for each project.

This hasn't been a problem before, but we have a lot of actions now that use this to detect changes. Is this action too API request-heavy?

Fetching list of changed files for PR#1063 from Github API
  Invoking listFiles(pull_number: 1063, page: 1, per_page: 100)
  ::endgroup::
Error: API rate limit exceeded for installation ID 16004555.

Using:

      - uses: actions/checkout@v2
        with:
          # This may save additional git fetch round trip if merge-base is found within latest 20 commits
          fetch-depth: 20
      # For pull requests it's not necessary to checkout the code
      - uses: dorny/paths-filter@v2
        id: filter
        with:
          filters: |
            should_include:
              - 'Project1/**'

I can't figure out which limit is this action is consuming.
https://docs.github.com/en/rest/reference/rate-limit

client.pulls.listFiles

Would this be considered core or subject to 1,000 req/sec limit?

@anomiex
Copy link

anomiex commented Feb 25, 2022

The action does do one more request than necessary, in that it fetches pages of files until getting a page with zero results instead of using Octokit's pagination that detects the last page without having to make the extra request.

But unless your PRs have thousands of files or you run this action hundreds of times per hour, it's probably something else using up the 1000 requests per hour rate limit and this action just fell victim to the limit already being exceeded.

@frouioui
Copy link
Contributor

This issue seems related to #73.

We are observing the same issue. @dorny, any update on a potential fix?

In the meantime I am trying to avoid using the GitHub API by setting the token to an empty string, however, the git command somehow lists all the files in the repository as added.

@dorny
Copy link
Owner

dorny commented Feb 15, 2024

#133 is merged and included in v3.0.1 release.
I'm closing the issue now. But please let me know in case the fix dit not solve your issue.

@dorny dorny closed this as completed Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants