@ -3153,16 +3153,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
for ( var p in m ) if ( p !== "default" && ! Object . prototype . hasOwnProperty . call ( exports , p ) ) _ _createBinding ( exports , m , p ) ;
} ;
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
exports . create = void 0 ;
const client _1 = _ _nccwpck _require _ _ ( 23955 ) ;
/ * *
* Exported functionality that we want to expose for any users of @ actions / artifact
* /
_ _exportStar ( _ _nccwpck _require _ _ ( 2538 ) , exports ) ;
function create ( ) {
return client _1 . Client . create ( ) ;
}
exports .create = create ;
_ _exportStar ( _ _nccwpck _require _ _ ( 69398 ) , exports ) ;
_ _exportStar ( _ _nccwpck _require _ _ ( 23955 ) , exports ) ;
const client = new client _1 . DefaultArtifactClient ( ) ;
exports ["default" ] = client ;
//# sourceMappingURL=artifact.js.map
/***/ } ) ,
@ -4998,32 +4994,24 @@ var __rest = (this && this.__rest) || function (s, e) {
return t ;
} ;
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
exports . Client = void 0 ;
exports . DefaultArtifact Client = void 0 ;
const core _1 = _ _nccwpck _require _ _ ( 66526 ) ;
const config _1 = _ _nccwpck _require _ _ ( 95042 ) ;
const upload _artifact _1 = _ _nccwpck _require _ _ ( 86278 ) ;
const download _artifact _1 = _ _nccwpck _require _ _ ( 17306 ) ;
const get _artifact _1 = _ _nccwpck _require _ _ ( 56218 ) ;
const list _artifacts _1 = _ _nccwpck _require _ _ ( 64033 ) ;
class Client {
/ * *
* Constructs a Client
* /
static create ( ) {
return new Client ( ) ;
}
/ * *
* Upload Artifact
* /
const errors _1 = _ _nccwpck _require _ _ ( 69398 ) ;
/ * *
* The default artifact client that is used by the artifact action ( s ) .
* /
class DefaultArtifactClient {
uploadArtifact ( name , files , rootDirectory , options ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
if ( ( 0 , config _1 . isGhes ) ( ) ) {
( 0 , core _1 . warning ) ( ` @actions/artifact v2.0.0+ and upload-artifact@v4+ are not currently supported on GHES. ` ) ;
return {
success : false
} ;
}
try {
if ( ( 0 , config _1 . isGhes ) ( ) ) {
throw new errors _1 . GHESNotSupportedError ( ) ;
}
return ( 0 , upload _artifact _1 . uploadArtifact ) ( name , files , rootDirectory , options ) ;
}
catch ( error ) {
@ -5032,24 +5020,16 @@ class Client {
Errors can be temporary , so please try again and optionally run the action with debug mode enabled for more information .
If the error persists , please check whether Actions is operating normally at [ https : //githubstatus.com](https://www.githubstatus.com).`);
return {
success : false
} ;
throw error ;
}
} ) ;
}
/ * *
* Download Artifact
* /
downloadArtifact ( artifactId , options ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
if ( ( 0 , config _1 . isGhes ) ( ) ) {
( 0 , core _1 . warning ) ( ` @actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES. ` ) ;
return {
success : false
} ;
}
try {
if ( ( 0 , config _1 . isGhes ) ( ) ) {
throw new errors _1 . GHESNotSupportedError ( ) ;
}
if ( options === null || options === void 0 ? void 0 : options . findBy ) {
const { findBy : { repositoryOwner , repositoryName , token } } = options , downloadOptions = _ _rest ( options , [ "findBy" ] ) ;
return ( 0 , download _artifact _1 . downloadArtifactPublic ) ( artifactId , repositoryOwner , repositoryName , token , downloadOptions ) ;
@ -5057,29 +5037,21 @@ If the error persists, please check whether Actions is operating normally at [ht
return ( 0 , download _artifact _1 . downloadArtifactInternal ) ( artifactId , options ) ;
}
catch ( error ) {
( 0 , core _1 . warning ) ( ` Artifact download failed with error: ${ error } .
( 0 , core _1 . warning ) ( ` Download Artifact failed with error: ${ error } .
Errors can be temporary , so please try again and optionally run the action with debug mode enabled for more information .
If the error persists , please check whether Actions and API requests are operating normally at [ https : //githubstatus.com](https://www.githubstatus.com).`);
return {
success : false
} ;
throw error ;
}
} ) ;
}
/ * *
* List Artifacts
* /
listArtifacts ( options ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
if ( ( 0 , config _1 . isGhes ) ( ) ) {
( 0 , core _1 . warning ) ( ` @actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES. ` ) ;
return {
artifacts : [ ]
} ;
}
try {
if ( ( 0 , config _1 . isGhes ) ( ) ) {
throw new errors _1 . GHESNotSupportedError ( ) ;
}
if ( options === null || options === void 0 ? void 0 : options . findBy ) {
const { findBy : { workflowRunId , repositoryOwner , repositoryName , token } } = options ;
return ( 0 , list _artifacts _1 . listArtifactsPublic ) ( workflowRunId , repositoryOwner , repositoryName , token , options === null || options === void 0 ? void 0 : options . latest ) ;
@ -5092,24 +5064,16 @@ If the error persists, please check whether Actions and API requests are operati
Errors can be temporary , so please try again and optionally run the action with debug mode enabled for more information .
If the error persists , please check whether Actions and API requests are operating normally at [ https : //githubstatus.com](https://www.githubstatus.com).`);
return {
artifacts : [ ]
} ;
throw error ;
}
} ) ;
}
/ * *
* Get Artifact
* /
getArtifact ( artifactName , options ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
if ( ( 0 , config _1 . isGhes ) ( ) ) {
( 0 , core _1 . warning ) ( ` @actions/artifact v2.0.0+ and download-artifact@v4+ are not currently supported on GHES. ` ) ;
return {
success : false
} ;
}
try {
if ( ( 0 , config _1 . isGhes ) ( ) ) {
throw new errors _1 . GHESNotSupportedError ( ) ;
}
if ( options === null || options === void 0 ? void 0 : options . findBy ) {
const { findBy : { workflowRunId , repositoryOwner , repositoryName , token } } = options ;
return ( 0 , get _artifact _1 . getArtifactPublic ) ( artifactName , workflowRunId , repositoryOwner , repositoryName , token ) ;
@ -5117,19 +5081,17 @@ If the error persists, please check whether Actions and API requests are operati
return ( 0 , get _artifact _1 . getArtifactInternal ) ( artifactName ) ;
}
catch ( error ) {
( 0 , core _1 . warning ) ( ` Fetching Artifact failed with error: ${ error } .
( 0 , core _1 . warning ) ( ` Get Artifact failed with error: ${ error } .
Errors can be temporary , so please try again and optionally run the action with debug mode enabled for more information .
If the error persists , please check whether Actions and API requests are operating normally at [ https : //githubstatus.com](https://www.githubstatus.com).`);
return {
success : false
} ;
throw error ;
}
} ) ;
}
}
exports . Client = Client;
exports . DefaultArtifact Client = DefaultArtifact Client;
//# sourceMappingURL=client.js.map
/***/ } ) ,
@ -5186,6 +5148,7 @@ const config_1 = __nccwpck_require__(95042);
const artifact _twirp _client _1 = _ _nccwpck _require _ _ ( 63550 ) ;
const generated _1 = _ _nccwpck _require _ _ ( 90265 ) ;
const util _1 = _ _nccwpck _require _ _ ( 80565 ) ;
const errors _1 = _ _nccwpck _require _ _ ( 69398 ) ;
const scrubQueryParameters = ( url ) => {
const parsed = new URL ( url ) ;
parsed . search = '' ;
@ -5247,7 +5210,7 @@ function downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, tok
catch ( error ) {
throw new Error ( ` Unable to download and extract artifact: ${ error . message } ` ) ;
}
return { success: true , downloadPath } ;
return { downloadPath } ;
} ) ;
}
exports . downloadArtifactPublic = downloadArtifactPublic ;
@ -5263,8 +5226,7 @@ function downloadArtifactInternal(artifactId, options) {
} ;
const { artifacts } = yield artifactClient . ListArtifacts ( listReq ) ;
if ( artifacts . length === 0 ) {
core . warning ( ` No artifacts found for ID: ${ artifactId } \n Are you trying to download from a different run? Try specifying a github-token with \` actions:read \` scope. ` ) ;
return { success : false } ;
throw new errors _1 . ArtifactNotFoundError ( ` No artifacts found for ID: ${ artifactId } \n Are you trying to download from a different run? Try specifying a github-token with \` actions:read \` scope. ` ) ;
}
if ( artifacts . length > 1 ) {
core . warning ( 'Multiple artifacts found, defaulting to first.' ) ;
@ -5284,7 +5246,7 @@ function downloadArtifactInternal(artifactId, options) {
catch ( error ) {
throw new Error ( ` Unable to download and extract artifact: ${ error . message } ` ) ;
}
return { success: true , downloadPath } ;
return { downloadPath } ;
} ) ;
}
exports . downloadArtifactInternal = downloadArtifactInternal ;
@ -5353,7 +5315,9 @@ const util_1 = __nccwpck_require__(80565);
const user _agent _1 = _ _nccwpck _require _ _ ( 79681 ) ;
const artifact _twirp _client _1 = _ _nccwpck _require _ _ ( 63550 ) ;
const generated _1 = _ _nccwpck _require _ _ ( 90265 ) ;
const errors _1 = _ _nccwpck _require _ _ ( 69398 ) ;
function getArtifactPublic ( artifactName , workflowRunId , repositoryOwner , repositoryName , token ) {
var _a ;
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
const [ retryOpts , requestOpts ] = ( 0 , retry _options _1 . getRetryOptions ) ( utils _1 . defaults ) ;
const opts = {
@ -5371,16 +5335,10 @@ function getArtifactPublic(artifactName, workflowRunId, repositoryOwner, reposit
name : artifactName
} ) ;
if ( getArtifactResp . status !== 200 ) {
core . warning ( ` non-200 response from GitHub API: ${ getArtifactResp . status } ` ) ;
return {
success : false
} ;
throw new errors _1 . InvalidResponseError ( ` Invalid response from GitHub API: ${ getArtifactResp . status } ( ${ ( _a = getArtifactResp === null || getArtifactResp === void 0 ? void 0 : getArtifactResp . headers ) === null || _a === void 0 ? void 0 : _a [ 'x-github-request-id' ] } ) ` ) ;
}
if ( getArtifactResp . data . artifacts . length === 0 ) {
core . warning ( 'no artifacts found' ) ;
return {
success : false
} ;
throw new errors _1 . ArtifactNotFoundError ( ` Artifact not found for name: ${ artifactName } ` ) ;
}
let artifact = getArtifactResp . data . artifacts [ 0 ] ;
if ( getArtifactResp . data . artifacts . length > 1 ) {
@ -5388,7 +5346,6 @@ function getArtifactPublic(artifactName, workflowRunId, repositoryOwner, reposit
core . debug ( ` More than one artifact found for a single name, returning newest (id: ${ artifact . id } ) ` ) ;
}
return {
success : true ,
artifact : {
name : artifact . name ,
id : artifact . id ,
@ -5410,18 +5367,14 @@ function getArtifactInternal(artifactName) {
} ;
const res = yield artifactClient . ListArtifacts ( req ) ;
if ( res . artifacts . length === 0 ) {
core . warning ( 'no artifacts found' ) ;
return {
success : false
} ;
throw new errors _1 . ArtifactNotFoundError ( ` Artifact not found for name: ${ artifactName } ` ) ;
}
let artifact = res . artifacts [ 0 ] ;
if ( res . artifacts . length > 1 ) {
artifact = res . artifacts . sort ( ( a , b ) => Number ( b . databaseId ) - Number ( a . databaseId ) ) [ 0 ] ;
core . debug ( ` m ore than one artifact found for a single name, returning newest (id: ${ artifact . databaseId } ) ` ) ;
core . debug ( ` M ore than one artifact found for a single name, returning newest (id: ${ artifact . databaseId } ) ` ) ;
}
return {
success : true ,
artifact : {
name : artifact . name ,
id : Number ( artifact . databaseId ) ,
@ -5844,6 +5797,50 @@ exports.getConcurrency = getConcurrency;
/***/ } ) ,
/***/ 69398 :
/***/ ( ( _ _unused _webpack _module , exports ) => {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
exports . GHESNotSupportedError = exports . ArtifactNotFoundError = exports . InvalidResponseError = exports . FilesNotFoundError = void 0 ;
class FilesNotFoundError extends Error {
constructor ( files = [ ] ) {
let message = 'No files were found to upload' ;
if ( files . length > 0 ) {
message += ` : ${ files . join ( ', ' ) } ` ;
}
super ( message ) ;
this . files = files ;
this . name = 'FilesNotFoundError' ;
}
}
exports . FilesNotFoundError = FilesNotFoundError ;
class InvalidResponseError extends Error {
constructor ( message ) {
super ( message ) ;
this . name = 'InvalidResponseError' ;
}
}
exports . InvalidResponseError = InvalidResponseError ;
class ArtifactNotFoundError extends Error {
constructor ( message = 'Artifact not found' ) {
super ( message ) ;
this . name = 'ArtifactNotFoundError' ;
}
}
exports . ArtifactNotFoundError = ArtifactNotFoundError ;
class GHESNotSupportedError extends Error {
constructor ( message = '@actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES.' ) {
super ( message ) ;
this . name = 'GHESNotSupportedError' ;
}
}
exports . GHESNotSupportedError = GHESNotSupportedError ;
//# sourceMappingURL=errors.js.map
/***/ } ) ,
/***/ 2538 :
/***/ ( ( _ _unused _webpack _module , exports ) => {
@ -6027,28 +6024,16 @@ function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) {
const hashStream = crypto . createHash ( 'sha256' ) ;
zipUploadStream . pipe ( uploadStream ) ; // This stream is used for the upload
zipUploadStream . pipe ( hashStream ) . setEncoding ( 'hex' ) ; // This stream is used to compute a hash of the zip content that gets used. Integrity check
try {
core . info ( 'Beginning upload of artifact content to blob storage' ) ;
yield blockBlobClient . uploadStream ( uploadStream , bufferSize , maxConcurrency , options ) ;
core . info ( 'Finished uploading artifact content to blob storage!' ) ;
hashStream . end ( ) ;
sha256Hash = hashStream . read ( ) ;
core . info ( ` SHA256 hash of uploaded artifact zip is ${ sha256Hash } ` ) ;
}
catch ( error ) {
core . warning ( ` Failed to upload artifact zip to blob storage, error: ${ error } ` ) ;
return {
isSuccess : false
} ;
}
core . info ( 'Beginning upload of artifact content to blob storage' ) ;
yield blockBlobClient . uploadStream ( uploadStream , bufferSize , maxConcurrency , options ) ;
core . info ( 'Finished uploading artifact content to blob storage!' ) ;
hashStream . end ( ) ;
sha256Hash = hashStream . read ( ) ;
core . info ( ` SHA256 hash of uploaded artifact zip is ${ sha256Hash } ` ) ;
if ( uploadByteCount === 0 ) {
core . warning ( ` No data was uploaded to blob storage. Reported upload byte count is 0 ` ) ;
return {
isSuccess : false
} ;
core . warning ( ` No data was uploaded to blob storage. Reported upload byte count is 0. ` ) ;
}
return {
isSuccess : true ,
uploadSize : uploadByteCount ,
sha256Hash
} ;
@ -6242,16 +6227,14 @@ const util_1 = __nccwpck_require__(80565);
const blob _upload _1 = _ _nccwpck _require _ _ ( 63311 ) ;
const zip _1 = _ _nccwpck _require _ _ ( 6180 ) ;
const generated _1 = _ _nccwpck _require _ _ ( 90265 ) ;
const errors _1 = _ _nccwpck _require _ _ ( 69398 ) ;
function uploadArtifact ( name , files , rootDirectory , options ) {
return _ _awaiter ( this , void 0 , void 0 , function * ( ) {
( 0 , path _and _artifact _name _validation _1 . validateArtifactName ) ( name ) ;
( 0 , upload _zip _specification _1 . validateRootDirectory ) ( rootDirectory ) ;
const zipSpecification = ( 0 , upload _zip _specification _1 . getUploadZipSpecification ) ( files , rootDirectory ) ;
if ( zipSpecification . length === 0 ) {
core . warning ( ` No files were found to upload ` ) ;
return {
success : false
} ;
throw new errors _1 . FilesNotFoundError ( zipSpecification . flatMap ( s => ( s . sourcePath ? [ s . sourcePath ] : [ ] ) ) ) ;
}
const zipUploadStream = yield ( 0 , zip _1 . createZipUploadStream ) ( zipSpecification , options === null || options === void 0 ? void 0 : options . compressionLevel ) ;
// get the IDs needed for the artifact creation
@ -6272,18 +6255,10 @@ function uploadArtifact(name, files, rootDirectory, options) {
}
const createArtifactResp = yield artifactClient . CreateArtifact ( createArtifactReq ) ;
if ( ! createArtifactResp . ok ) {
core . warning ( ` Failed to create artifact ` ) ;
return {
success : false
} ;
throw new errors _1 . InvalidResponseError ( 'CreateArtifact: response from backend was not ok' ) ;
}
// Upload zip to blob storage
const uploadResult = yield ( 0 , blob _upload _1 . uploadZipToBlobStorage ) ( createArtifactResp . signedUploadUrl , zipUploadStream ) ;
if ( uploadResult . isSuccess === false ) {
return {
success : false
} ;
}
// finalize the artifact
const finalizeArtifactReq = {
workflowRunBackendId : backendIds . workflowRunBackendId ,
@ -6299,15 +6274,11 @@ function uploadArtifact(name, files, rootDirectory, options) {
core . info ( ` Finalizing artifact upload ` ) ;
const finalizeArtifactResp = yield artifactClient . FinalizeArtifact ( finalizeArtifactReq ) ;
if ( ! finalizeArtifactResp . ok ) {
core . warning ( ` Failed to finalize artifact ` ) ;
return {
success : false
} ;
throw new errors _1 . InvalidResponseError ( 'FinalizeArtifact: response from backend was not ok' ) ;
}
const artifactId = BigInt ( finalizeArtifactResp . artifactId ) ;
core . info ( ` Artifact ${ name } .zip successfully finalized. Artifact ID ${ artifactId } ` ) ;
return {
success : true ,
size : uploadResult . uploadSize ,
id : Number ( artifactId )
} ;
@ -122076,9 +122047,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
} ) ;
} ;
var _ _importDefault = ( this && this . _ _importDefault ) || function ( mod ) {
return ( mod && mod . _ _esModule ) ? mod : { "default" : mod } ;
} ;
Object . defineProperty ( exports , "__esModule" , ( { value : true } ) ) ;
const core = _ _importStar ( _ _nccwpck _require _ _ ( 42186 ) ) ;
const artifact _1 = _ _nccwpck _require _ _ ( 99860 ) ;
const artifact _1 = _ _ importDefault( _ _ nccwpck_require _ _ ( 99860 ) ) ;
const search _1 = _ _nccwpck _require _ _ ( 13930 ) ;
const input _helper _1 = _ _nccwpck _require _ _ ( 46455 ) ;
const constants _1 = _ _nccwpck _require _ _ ( 69042 ) ;
@ -122108,7 +122082,6 @@ function run() {
const s = searchResult . filesToUpload . length === 1 ? '' : 's' ;
core . info ( ` With the provided path, there will be ${ searchResult . filesToUpload . length } file ${ s } uploaded ` ) ;
core . debug ( ` Root artifact directory is ${ searchResult . rootDirectory } ` ) ;
const artifactClient = ( 0 , artifact _1 . create ) ( ) ;
const options = { } ;
if ( inputs . retentionDays ) {
options . retentionDays = inputs . retentionDays ;
@ -122116,14 +122089,9 @@ function run() {
if ( typeof inputs . compressionLevel !== 'undefined' ) {
options . compressionLevel = inputs . compressionLevel ;
}
const uploadResponse = yield artifactClient . uploadArtifact ( inputs . artifactName , searchResult . filesToUpload , searchResult . rootDirectory , options ) ;
if ( uploadResponse . success === false ) {
core . setFailed ( ` An error was encountered when uploading ${ inputs . artifactName } . ` ) ;
}
else {
core . info ( ` Artifact ${ inputs . artifactName } has been successfully uploaded! Final size is ${ uploadResponse . size } bytes. Artifact ID is ${ uploadResponse . id } ` ) ;
core . setOutput ( 'artifact-id' , uploadResponse . id ) ;
}
const uploadResponse = yield artifact _1 . default . uploadArtifact ( inputs . artifactName , searchResult . filesToUpload , searchResult . rootDirectory , options ) ;
core . info ( ` Artifact ${ inputs . artifactName } has been successfully uploaded! Final size is ${ uploadResponse . size } bytes. Artifact ID is ${ uploadResponse . id } ` ) ;
core . setOutput ( 'artifact-id' , uploadResponse . id ) ;
}
}
catch ( error ) {