* Check if an error is due to a GitHub API rate limit being exceeded. * This includes both installation-level and user-level rate limits. * Used to determine if a check should fail-open (allow workflow to proceed) * rather than hard-failing when the error is transient. * * @param {unknown} erro
(error)
| 76 | * @returns {boolean} True if error is due to API rate limiting, false otherwise |
| 77 | */ |
| 78 | function isRateLimitError(error) { |
| 79 | const errorMessage = getErrorMessage(error); |
| 80 | return /\bapi rate limit\b|\brate limit exceeded\b/i.test(errorMessage); |
| 81 | } |
| 82 | |
| 83 | module.exports = { getErrorMessage, isHtmlContent, isLockedError, isRateLimitError }; |