Skip to content

Excessive API call usage #567

@anomiex

Description

@anomiex

It appears that the recommended configuration for this action will make 11 calls to the GitHub REST API per push and per language, which can add up quickly and make it too easy to reach the rate limit of 1000 calls per hour with the default Actions token.

  • getWorkflowPath() makes two calls, and seems to be called twice from github/codeql-action/init@v1.
  • github/codeql-action/init@v1 then makes two calls to update the status.
  • github/codeql-action/autobuild@v1 also makes two calls to update the status.
  • github/codeql-action/analyze@v1 makes another two calls to update the status, plus one more in between to actually upload the results.

I'd expect just two or three calls to actually be needed: one (maybe) to update the status to "working" at the start, one to upload the results, and one to update the status to "completed" at the end.

If the cache key and linting are needed, could you convince the Actions team to supply the workflow file path via an environment variable or context property so you don't have to make two API calls to fetch it? It looks like they already conditionally provide this information in github.workflow (and maybe also GITHUB_WORKFLOW) if the workflow yaml file doesn't name the workflow itself.

FYI, this came up when I was working with GitHub Developer Support to try to figure out why we kept hitting the API rate limits, and I noticed that this action was responsible for a significant fraction of the calls. The support person suggested I report it to you directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions