mirror of
https://github.com/actions/upload-artifact
synced 2024-12-22 06:22:45 +00:00
commit
0ff37d0dc6
3 changed files with 116055 additions and 5512 deletions
121549
dist/index.js
vendored
121549
dist/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -5,7 +5,7 @@
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"release": "ncc build src/upload-artifact.ts && git add -f dist/",
|
"release": "ncc build src/upload-artifact.ts && git add -f dist/index.js",
|
||||||
"check-all": "concurrently \"npm:format-check\" \"npm:lint\" \"npm:test\" \"npm:build\"",
|
"check-all": "concurrently \"npm:format-check\" \"npm:lint\" \"npm:test\" \"npm:build\"",
|
||||||
"format": "prettier --write **/*.ts",
|
"format": "prettier --write **/*.ts",
|
||||||
"format-check": "prettier --check **/*.ts",
|
"format-check": "prettier --check **/*.ts",
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/actions/upload-artifact#readme",
|
"homepage": "https://github.com/actions/upload-artifact#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/artifact": "^1.1.1",
|
"@actions/artifact": "^2.0.0",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/glob": "^0.3.0",
|
"@actions/glob": "^0.3.0",
|
||||||
"@actions/io": "^1.1.2"
|
"@actions/io": "^1.1.2"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as core from '@actions/core'
|
import * as core from '../node_modules/@actions/core/'
|
||||||
import {create, UploadOptions} from '@actions/artifact'
|
import {UploadOptions, create} from '../node_modules/@actions/artifact/lib/artifact'
|
||||||
import {findFilesToUpload} from './search'
|
import {findFilesToUpload} from './search'
|
||||||
import {getInputs} from './input-helper'
|
import {getInputs} from './input-helper'
|
||||||
import {NoFileOptions} from './constants'
|
import {NoFileOptions} from './constants'
|
||||||
|
@ -44,9 +44,7 @@ async function run(): Promise<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const artifactClient = create()
|
const artifactClient = create()
|
||||||
const options: UploadOptions = {
|
const options: UploadOptions = {}
|
||||||
continueOnError: false
|
|
||||||
}
|
|
||||||
if (inputs.retentionDays) {
|
if (inputs.retentionDays) {
|
||||||
options.retentionDays = inputs.retentionDays
|
options.retentionDays = inputs.retentionDays
|
||||||
}
|
}
|
||||||
|
@ -58,13 +56,13 @@ async function run(): Promise<void> {
|
||||||
options
|
options
|
||||||
)
|
)
|
||||||
|
|
||||||
if (uploadResponse.failedItems.length > 0) {
|
if (uploadResponse.success === false) {
|
||||||
core.setFailed(
|
core.setFailed(
|
||||||
`An error was encountered when uploading ${uploadResponse.artifactName}. There were ${uploadResponse.failedItems.length} items that failed to upload.`
|
`An error was encountered when uploading ${inputs.artifactName}.`
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
core.info(
|
core.info(
|
||||||
`Artifact ${uploadResponse.artifactName} has been successfully uploaded!`
|
`Artifact ${inputs.artifactName} has been successfully uploaded! Final size is ${uploadResponse.size} bytes. Artifact ID is ${uploadResponse.id}}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue