mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-17 13:48:08 +08:00
implement feedback
This commit is contained in:
@@ -2,6 +2,7 @@ import {UploadOptions} from './upload/upload-options'
|
||||
import {UploadResponse} from './upload/upload-response'
|
||||
import {uploadArtifact} from './upload/upload-artifact'
|
||||
import {warning} from '@actions/core'
|
||||
import {isGhes} from './shared/config'
|
||||
|
||||
export interface ArtifactClient {
|
||||
/**
|
||||
@@ -40,10 +41,25 @@ export class Client implements ArtifactClient {
|
||||
rootDirectory: string,
|
||||
options?: UploadOptions | undefined
|
||||
): Promise<UploadResponse> {
|
||||
if (isGhes()) {
|
||||
warning(
|
||||
`@actions/artifact v2 and upload-artifact v4 are not currently supported on GHES.`
|
||||
)
|
||||
return {
|
||||
success: false
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
return uploadArtifact(name, files, rootDirectory, options)
|
||||
} catch (error) {
|
||||
warning(`Failed to upload artifact: ${error}`)
|
||||
warning(
|
||||
`Artifact upload failed with error: ${error}.
|
||||
|
||||
Errors can be temporary, so please try again and optionally run the action with debug enabled for more information.
|
||||
|
||||
If the error persists, please check whether Actions is running normally at [https://githubstatus.com](https://www.githubstatus.com).`
|
||||
)
|
||||
return {
|
||||
success: false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user