2023-08-17 14:40:33 -04:00
/*****************************************************************************
* *
* UploadArtifact *
* *
*****************************************************************************/
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-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
}
/*****************************************************************************
* *
* GetArtifact *
* *
*****************************************************************************/
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
}
/*****************************************************************************
* *
* ListArtifact *
* *
*****************************************************************************/
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-08-17 14:40:33 -04:00
export interface ListArtifactsResponse {
/**
* A list of artifacts that were found
*/
artifacts : Artifact [ ]
}
/*****************************************************************************
* *
* DownloadArtifact *
* *
*****************************************************************************/
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
}
export interface DownloadArtifactOptions {
/**
* Denotes where the artifact will be downloaded to. If not specified then the artifact is download to GITHUB_WORKSPACE
*/
path? : string
}
/*****************************************************************************
* *
* Shared *
* *
*****************************************************************************/
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.
2023-12-06 04:00:07 +00:00
// Must specify a token with actions:read scope for cross run/repo lookup otherwise these will be ignored.
2023-12-01 02:15:25 +00:00
export interface FindOptions {
findBy ? : {
// Token with actions:read permissions
token : string
// WorkflowRun of the artifact(s) to lookup
workflowRunId : number
// Repository owner
repositoryOwner : string
// Repository name
repositoryName : string
}
2023-11-30 03:47:04 +00:00
}