mirror of
https://code.forgejo.org/actions/download-artifact.git
synced 2024-12-23 04:06:00 +01:00
better fallback for path and append aritfact name for mutli-download
This commit is contained in:
parent
24b1443a07
commit
727cfbe442
2 changed files with 9 additions and 2 deletions
5
dist/index.js
vendored
5
dist/index.js
vendored
|
@ -118700,6 +118700,9 @@ function run() {
|
||||||
repository: core.getInput(constants_1.Inputs.Repository, { required: true }),
|
repository: core.getInput(constants_1.Inputs.Repository, { required: true }),
|
||||||
runID: parseInt(core.getInput(constants_1.Inputs.RunID, { required: true }))
|
runID: parseInt(core.getInput(constants_1.Inputs.RunID, { required: true }))
|
||||||
};
|
};
|
||||||
|
if (!inputs.path) {
|
||||||
|
inputs.path = process.env['GITHUB_WORKSPACE'] || process.cwd();
|
||||||
|
}
|
||||||
if (inputs.path.startsWith(`~`)) {
|
if (inputs.path.startsWith(`~`)) {
|
||||||
inputs.path = inputs.path.replace('~', os.homedir());
|
inputs.path = inputs.path.replace('~', os.homedir());
|
||||||
}
|
}
|
||||||
|
@ -118728,7 +118731,7 @@ function run() {
|
||||||
artifacts = listArtifactResponse.artifacts;
|
artifacts = listArtifactResponse.artifacts;
|
||||||
}
|
}
|
||||||
const downloadPromises = artifacts.map(artifact => artifactClient.downloadArtifact(artifact.id, owner, repo, inputs.token, {
|
const downloadPromises = artifacts.map(artifact => artifactClient.downloadArtifact(artifact.id, owner, repo, inputs.token, {
|
||||||
path: resolvedPath
|
path: path.join(resolvedPath, artifact.name)
|
||||||
}));
|
}));
|
||||||
const chunkedPromises = exports.chunk(downloadPromises, PARALLEL_DOWNLOADS);
|
const chunkedPromises = exports.chunk(downloadPromises, PARALLEL_DOWNLOADS);
|
||||||
for (const chunk of chunkedPromises) {
|
for (const chunk of chunkedPromises) {
|
||||||
|
|
|
@ -22,6 +22,10 @@ async function run(): Promise<void> {
|
||||||
runID: parseInt(core.getInput(Inputs.RunID, {required: true}))
|
runID: parseInt(core.getInput(Inputs.RunID, {required: true}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!inputs.path) {
|
||||||
|
inputs.path = process.env['GITHUB_WORKSPACE'] || process.cwd()
|
||||||
|
}
|
||||||
|
|
||||||
if (inputs.path.startsWith(`~`)) {
|
if (inputs.path.startsWith(`~`)) {
|
||||||
inputs.path = inputs.path.replace('~', os.homedir())
|
inputs.path = inputs.path.replace('~', os.homedir())
|
||||||
}
|
}
|
||||||
|
@ -77,7 +81,7 @@ async function run(): Promise<void> {
|
||||||
|
|
||||||
const downloadPromises = artifacts.map(artifact =>
|
const downloadPromises = artifacts.map(artifact =>
|
||||||
artifactClient.downloadArtifact(artifact.id, owner, repo, inputs.token, {
|
artifactClient.downloadArtifact(artifact.id, owner, repo, inputs.token, {
|
||||||
path: resolvedPath
|
path: path.join(resolvedPath, artifact.name)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue