mirror of
https://github.com/actions/stale.git
synced 2025-12-15 06:48:02 +00:00
Use cache instead of artifacts
This commit is contained in:
19
src/classes/actions-cache/http-responses.ts
Normal file
19
src/classes/actions-cache/http-responses.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import {TypedResponse} from '@actions/http-client/lib/interfaces';
|
||||
import {HttpClientError} from '@actions/http-client';
|
||||
|
||||
export const isSuccessStatusCode = (statusCode?: number): boolean => {
|
||||
if (!statusCode) {
|
||||
return false;
|
||||
}
|
||||
return statusCode >= 200 && statusCode < 300;
|
||||
};
|
||||
export function isServerErrorStatusCode(statusCode?: number): boolean {
|
||||
if (!statusCode) {
|
||||
return true;
|
||||
}
|
||||
return statusCode >= 500;
|
||||
}
|
||||
|
||||
export interface TypedResponseWithError<T> extends TypedResponse<T> {
|
||||
error?: HttpClientError;
|
||||
}
|
||||
Reference in New Issue
Block a user