2023-12-07 12:57:20 -05:00
/**
* Response from the server when an artifact is uploaded
*/
2023-12-03 06:24:49 +00:00
export interface UploadArtifactResponse {
2023-08-17 14:40:33 -04:00
/**
* Total size of the artifact in bytes. Not provided if no artifact was uploaded
*/
size? : number
/**
* The id of the artifact that was created. Not provided if no artifact was uploaded
* This ID can be used as input to other APIs to download, delete or get more information about an artifact: https://docs.github.com/en/rest/actions/artifacts
*/
id? : number
}
2023-12-07 12:57:20 -05:00
/**
* Options for uploading an artifact
*/
2023-12-03 06:24:49 +00:00
export interface UploadArtifactOptions {
2023-08-17 14:40:33 -04:00
/**
* Duration after which artifact will expire in days.
*
* By default artifact expires after 90 days:
* https://docs.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts#downloading-and-deleting-artifacts-after-a-workflow-run-is-complete
*
* Use this option to override the default expiry.
*
* Min value: 1
* Max value: 90 unless changed by repository setting
*
* If this is set to a greater value than the retention settings allowed, the retention on artifacts
* will be reduced to match the max value allowed on server, and the upload process will continue. An
* input of 0 assumes default retention setting.
*/
retentionDays? : number
2023-11-20 15:03:58 +00:00
/**
* The level of compression for Zlib to be applied to the artifact archive.
* The value can range from 0 to 9:
* - 0: No compression
* - 1: Best speed
* - 6: Default compression (same as GNU Gzip)
* - 9: Best compression
* Higher levels will result in better compression, but will take longer to complete.
* For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads.
*/
compressionLevel? : number
2023-08-17 14:40:33 -04:00
}
2023-12-07 12:57:20 -05:00
/**
* Response from the server when getting an artifact
*/
2023-08-17 14:40:33 -04:00
export interface GetArtifactResponse {
/**
* Metadata about the artifact that was found
*/
2023-12-05 18:42:36 +00:00
artifact : Artifact
2023-08-17 14:40:33 -04:00
}
2023-12-07 12:57:20 -05:00
/**
* Options for listing artifacts
*/
2023-12-03 05:01:20 +00:00
export interface ListArtifactsOptions {
/**
* Filter the workflow run's artifacts to the latest by name
* In the case of reruns, this can be useful to avoid duplicates
*/
latest? : boolean
}
2023-12-07 12:57:20 -05:00
/**
* Response from the server when listing artifacts
*/
2023-08-17 14:40:33 -04:00
export interface ListArtifactsResponse {
/**
* A list of artifacts that were found
*/
artifacts : Artifact [ ]
}
2023-12-07 12:57:20 -05:00
/**
* Response from the server when downloading an artifact
*/
2023-08-17 14:40:33 -04:00
export interface DownloadArtifactResponse {
2023-08-21 17:47:17 -04:00
/**
* The path where the artifact was downloaded to
*/
downloadPath? : string
2023-08-17 14:40:33 -04:00
}
2023-12-07 12:57:20 -05:00
/**
* Options for downloading an artifact
*/
2023-08-17 14:40:33 -04:00
export interface DownloadArtifactOptions {
/**
* Denotes where the artifact will be downloaded to. If not specified then the artifact is download to GITHUB_WORKSPACE
*/
path? : string
}
2023-12-07 12:57:20 -05:00
/**
* An Actions Artifact
*/
2023-08-17 14:40:33 -04:00
export interface Artifact {
/**
* The name of the artifact
*/
name : string
/**
* The ID of the artifact
*/
id : number
/**
* The size of the artifact in bytes
*/
size : number
2023-12-02 21:18:22 -05:00
/**
* The time when the artifact was created
*/
createdAt? : Date
2023-08-17 14:40:33 -04:00
}
2023-11-30 03:47:04 +00:00
2023-12-01 02:15:25 +00:00
// FindOptions are for fetching Artifact(s) out of the scope of the current run.
export interface FindOptions {
2023-12-07 12:57:20 -05:00
/**
* The criteria for finding Artifact(s) out of the scope of the current run.
*/
2023-12-01 02:15:25 +00:00
findBy ? : {
2023-12-07 12:57:20 -05:00
/**
* Token with actions:read permissions
*/
2023-12-01 02:15:25 +00:00
token : string
2023-12-07 12:57:20 -05:00
/**
* WorkflowRun of the artifact(s) to lookup
*/
2023-12-01 02:15:25 +00:00
workflowRunId : number
2023-12-07 12:57:20 -05:00
/**
* Repository owner (eg. 'actions')
*/
2023-12-01 02:15:25 +00:00
repositoryOwner : string
2023-12-07 12:57:20 -05:00
/**
* Repository owner (eg. 'toolkit')
*/
2023-12-01 02:15:25 +00:00
repositoryName : string
}
2023-11-30 03:47:04 +00:00
}
2024-01-17 16:18:49 -05:00
/**
* Response from the server when deleting an artifact
*/
export interface DeleteArtifactResponse {
/**
* The id of the artifact that was deleted
*/
id : number
}