Skip to content

Conversation

@DanApollo
Copy link
Contributor

@DanApollo DanApollo commented Dec 20, 2025

Why

Update action is failing due to rate limiting, this is because requests are not authenticated:

See Update #773

What

Unauthenticated requests by worker nodes are rate limited after a small amount of requests. However this can be avoided by authenticating requests Rate Limits for the Rest API

Test

I do not have access to the projects GitHub token, but I tested locally by generating a temporary classic PAT, and running the update script locally like so:

GH_TOKEN=your_token_here npx tsx scripts/commands/sites/update.ts

@DanApollo DanApollo force-pushed the fix-github-rate-limit branch from 9047d5f to 8a7749d Compare December 20, 2025 23:22
@freearhey
Copy link
Collaborator

The problem is that only 1 request should be sent to the GitHub API, since we only use it to download the currently open issues:

epg/scripts/core/utils.ts

Lines 93 to 102 in 0d8de71

issues = await octokit.paginate(octokit.rest.issues.listForRepo, {
owner: OWNER,
repo: REPO,
per_page: 100,
labels,
state: 'open',
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})

@DanApollo
Copy link
Contributor Author

The problem is that only 1 request should be sent to the GitHub API, since we only use it to download the currently open issues:

epg/scripts/core/utils.ts

Lines 93 to 102 in 0d8de71

issues = await octokit.paginate(octokit.rest.issues.listForRepo, {
owner: OWNER,
repo: REPO,
per_page: 100,
labels,
state: 'open',
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})

I see, in which case if you would prefer to keep rate limiting, I can close this and instead look into why more than one request is being sent.

@DanApollo
Copy link
Contributor Author

DanApollo commented Dec 21, 2025

Looking into this, without an auth token, it looks like the rate limit is shared across requests made within the whole org. I can't find any excessive requests made by any other repositories within the same hour as this job, but I also can't find any evidence that this request was made more than once.

I can only assume the runner was shared with another job that maxed the request limit within the hour.

@freearhey
Copy link
Collaborator

I think you're right.

So request authentication is really a good solution in this case.

@PopeyeTheSai10r PopeyeTheSai10r merged commit 671b585 into iptv-org:master Dec 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants