* Append a single rate-limit entry to the JSONL log file. * Errors are non-fatal – a warning is emitted to the Actions log. * * @param {Record } entry
(entry)
| 52 | * @param {Record<string, unknown>} entry |
| 53 | */ |
| 54 | function appendEntry(entry) { |
| 55 | try { |
| 56 | ensureDir(GITHUB_RATE_LIMITS_JSONL_PATH); |
| 57 | const line = JSON.stringify(entry) + "\n"; |
| 58 | fs.appendFileSync(GITHUB_RATE_LIMITS_JSONL_PATH, line); |
| 59 | } catch (err) { |
| 60 | core.warning(`github_rate_limit_logger: failed to write entry: ${getErrorMessage(err)}`); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Parse an x-ratelimit-reset Unix timestamp (seconds) into an ISO 8601 string. |
no test coverage detected