Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Commit e13efd0

Browse files
committed
feataccount for reset window crossing
1 parent 0162ffc commit e13efd0

11 files changed

Lines changed: 28155 additions & 34 deletions

File tree

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,21 @@ After your job completes, you'll get a nice summary:
5353

5454
## Outputs
5555

56-
| Name | Description |
57-
| ----- | --------------------------------------------------------------------------------- |
58-
| usage | JSON string with total, duration_ms, and buckets_data (per-bucket used/remaining) |
56+
| Name | Description |
57+
| ----- | --------------------------------------------------------------------------------------------------------------------------------- |
58+
| usage | JSON string with total, duration_ms, total_is_minimum, and buckets_data (per-bucket used/remaining/crossed_reset/used_is_minimum) |
5959

6060
Example output:
6161

6262
```json
6363
{
6464
"total": 60,
6565
"duration_ms": 12345,
66+
"total_is_minimum": false,
6667
"buckets_data": {
67-
"core": { "used": 45, "remaining": 4955 },
68-
"graphql": { "used": 10, "remaining": 4990 },
69-
"search": { "used": 5, "remaining": 25 }
68+
"core": { "used": 45, "remaining": 4955, "crossed_reset": false, "used_is_minimum": false },
69+
"graphql": { "used": 10, "remaining": 4990, "crossed_reset": false, "used_is_minimum": false },
70+
"search": { "used": 5, "remaining": 25, "crossed_reset": false, "used_is_minimum": false }
7071
}
7172
}
7273
```
@@ -77,6 +78,8 @@ Example output:
7778
- The action uses pre and post job hooks to snapshot the rate limit, so you only need to use it in one step - the rest will be handled automatically.
7879
- Output is set in the post step, so it is only available after the job completes (use job outputs if needed).
7980
- Logs are emitted via `core.debug()`. Enable step debug logging to view them.
81+
- If a reset window is crossed for a bucket, usage for that bucket is reported as a minimum because calls between the pre-snapshot and the reset are not observable.
82+
- The main step captures a checkpoint snapshot; if it occurs before a reset, the minimum includes usage observed up to that checkpoint.
8083
- GitHub's primary rate limits appear to use fixed windows with reset times anchored to the first observed usage of the token (per resource bucket), rather than calendar-aligned rolling windows.”
8184
• GitHub’s primary rate limit for Actions using the GITHUB_TOKEN is 1,000 REST API requests per hour per repository (or 15,000 per hour per repository when accessing GitHub Enterprise Cloud resources). This limit is specific to the automatically generated GITHUB_TOKEN and is independent of the standard REST API limits for other token types.
8285
Reference: GitHub Actions limits documentation — “The rate limit for GITHUB_TOKEN is 1,000 requests per hour per repository.”

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ outputs:
2626
runs:
2727
using: node20
2828
pre: dist/pre/index.js
29-
main: dist/noop/index.js
29+
main: dist/checkpoint/index.js
3030
post: dist/post/index.js

0 commit comments

Comments
 (0)