paths-filter icon indicating copy to clipboard operation
paths-filter copied to clipboard

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

Open teebu opened this issue 4 years ago • 2 comments

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?

teebu avatar Oct 07 '21 21:10 teebu

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.

anomiex avatar Feb 25 '22 18:02 anomiex

This issue seems related to https://github.com/dorny/paths-filter/issues/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.

frouioui avatar Apr 19 '22 08:04 frouioui

#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 avatar Feb 15 '24 08:02 dorny