@actions/artifact package updates (#408)

* Clear error message when storage quota has been hit

* Improved download of empty files

* Extra info to RELEASES.md

* PR Feedback
This commit is contained in:
Konrad Pabjan
2020-04-09 17:14:12 +02:00
committed by GitHub
parent 1b521c4778
commit c010a271d9
10 changed files with 180 additions and 20 deletions

View File

@@ -58,6 +58,14 @@ export function isSuccessStatusCode(statusCode?: number): boolean {
return statusCode >= 200 && statusCode < 300
}
export function isForbiddenStatusCode(statusCode?: number): boolean {
if (!statusCode) {
return false
}
return statusCode === HttpCodes.Forbidden
}
export function isRetryableStatusCode(statusCode?: number): boolean {
if (!statusCode) {
return false
@@ -296,3 +304,11 @@ export async function createDirectoriesForArtifact(
})
}
}
export async function createEmptyFilesForArtifact(
emptyFilesToCreate: string[]
): Promise<void> {
for (const filePath of emptyFilesToCreate) {
await (await fs.open(filePath, 'w')).close()
}
}