Skip to content

Use conditional API requests #295

@carlobeltrame

Description

@carlobeltrame

We are using this action and await-remote-run to trigger workflows on 22 other repositories from one repository. We are quickly running into the rate limits of the GitHub API of 5000 requests per hour with a PAT, even when limiting the number of parallel triggered workflows. One of the reasons is that sometimes we need to poll for a long time until the remote workflow starts running, because our available runners are occupied with other workflows (or even with the many waiting and polling workflows in the main repository).

For this reason, I am looking for ways to reduce the number of API requests counting towards our rate limit. One approach offered by GitHub is conditional API requests. The listWorkflowRuns (used in return-dispatch), listJobsForWorkflowRun (used in both actions) and getWorkflowRun (used in await-remote-run) endpoints all return an ETag. We could keep track of the etag of the previous request of the same type, and add an if-none-match header where possible.

If you think this is a good idea, I could work on PRs for both actions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions