Add artifact-id output to v4-beta (#448)

* Add artifact-id to outputs

* ncc

---------

Co-authored-by: Rob Herley <[email protected]>
This commit is contained in:
Konrad Pabjan
2023-10-26 12:05:31 -04:00
committed by GitHub
co-authored by Rob Herley
parent f87a4089c5
commit aa5cae10db
4 changed files with 75 additions and 107 deletions
+64 -95
View File
File diff suppressed because one or more lines are too long
+7 -1
View File
@@ -23,6 +23,12 @@ inputs:
Minimum 1 day.
Maximum 90 days unless changed from the repository settings page.
outputs:
artifact-id:
description: >
A unique identifier for the artifact that was just uploaded. Empty if artifact upload failed.
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
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
+2 -4
View File
@@ -121406,9 +121406,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}`);
if (searchResult.filesToUpload.length > 10000) {
core.warning(`There are over 10,000 files in this artifact, consider creating an archive before upload to improve the upload performance.`);
}
const artifactClient = (0, artifact_1.create)();
const options = {};
if (inputs.retentionDays) {
@@ -121419,7 +121416,8 @@ function run() {
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.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);
}
}
}
+2 -7
View File
@@ -37,12 +37,6 @@ async function run(): Promise<void> {
)
core.debug(`Root artifact directory is ${searchResult.rootDirectory}`)
if (searchResult.filesToUpload.length > 10000) {
core.warning(
`There are over 10,000 files in this artifact, consider creating an archive before upload to improve the upload performance.`
)
}
const artifactClient = create()
const options: UploadOptions = {}
if (inputs.retentionDays) {
@@ -62,8 +56,9 @@ async function run(): Promise<void> {
)
} else {
core.info(
`Artifact ${inputs.artifactName} has been successfully uploaded! Final size is ${uploadResponse.size} bytes. Artifact ID is ${uploadResponse.id}}`
`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) {