@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

@@ -15,6 +15,7 @@ import {
isRetryableStatusCode,
isSuccessStatusCode,
isThrottledStatusCode,
isForbiddenStatusCode,
displayHttpDiagnostics,
getExponentialRetryTimeInMilliseconds,
tryGetRetryAfterValueTimeInMilliseconds
@@ -68,6 +69,12 @@ export class UploadHttpClient {
if (isSuccessStatusCode(rawResponse.message.statusCode) && body) {
return JSON.parse(body)
} else if (isForbiddenStatusCode(rawResponse.message.statusCode)) {
// if a 403 is returned when trying to create a file container, the customer has exceeded
// their storage quota so no new artifact containers can be created
throw new Error(
`Artifact storage quota has been hit. Unable to upload any new artifacts`
)
} else {
displayHttpDiagnostics(rawResponse)
throw new Error(