1
0
Fork 0
mirror of https://code.forgejo.org/actions/download-artifact synced 2025-07-06 10:15:59 +02:00

Update download-artifact.ts

This commit is contained in:
Austin Sasko 2022-03-14 15:22:54 -04:00 committed by GitHub
parent d6ab5a844b
commit a64f201980
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,14 @@ async function run(): Promise<void> {
try { try {
const name = core.getInput(Inputs.Name, {required: false}) const name = core.getInput(Inputs.Name, {required: false})
const path = core.getInput(Inputs.Path, {required: false}) const path = core.getInput(Inputs.Path, {required: false})
const dontextract = core.getInput(Inputs.Dontextract, {required: false})
let stayGzipped
if(dontextract == "True") {
stayGzipped = True
} else {
stayGzipped = False
}
let resolvedPath let resolvedPath
// resolve tilde expansions, path.replace only replaces the first occurrence of a pattern // resolve tilde expansions, path.replace only replaces the first occurrence of a pattern
if (path.startsWith(`~`)) { if (path.startsWith(`~`)) {
@ -43,7 +50,8 @@ async function run(): Promise<void> {
const downloadResponse = await artifactClient.downloadArtifact( const downloadResponse = await artifactClient.downloadArtifact(
name, name,
resolvedPath, resolvedPath,
downloadOptions downloadOptions,
stayGzipped
) )
core.info( core.info(
`Artifact ${downloadResponse.artifactName} was downloaded to ${downloadResponse.downloadPath}` `Artifact ${downloadResponse.artifactName} was downloaded to ${downloadResponse.downloadPath}`