mirror of
https://github.com/actions/download-artifact.git
synced 2025-04-23 14:46:43 +08:00
use the same artifactClient.getArtifact
structure as seen above in isSingleArtifactDownload
logic
This commit is contained in:
parent
e463631f66
commit
171183c7dc
@ -114,24 +114,22 @@ export async function run(): Promise<void> {
|
||||
core.debug(
|
||||
`Only one artifact ID provided. Fetching latest artifact by its name and checking the ID`
|
||||
)
|
||||
const getArtifactResponse = await artifactClient.getArtifact(
|
||||
const {artifact: targetArtifact} = await artifactClient.getArtifact(
|
||||
inputs.name,
|
||||
{...options}
|
||||
options
|
||||
)
|
||||
|
||||
if (!getArtifactResponse || !getArtifactResponse.artifact) {
|
||||
if (!targetArtifact) {
|
||||
throw new Error(
|
||||
`Artifact with ID '${artifactIds[0]}' not found. Please check the ID.`
|
||||
)
|
||||
}
|
||||
|
||||
const artifact = getArtifactResponse.artifact
|
||||
|
||||
core.debug(
|
||||
`Found artifact by ID '${artifact.name}' (ID: ${artifact.id}, Size: ${artifact.size})`
|
||||
`Found artifact by ID '${targetArtifact.name}' (ID: ${targetArtifact.id}, Size: ${targetArtifact.size})`
|
||||
)
|
||||
|
||||
artifacts = [artifact]
|
||||
artifacts = [targetArtifact]
|
||||
} else {
|
||||
core.info(
|
||||
`Multiple artifact IDs provided. Fetching all artifacts to filter by ID`
|
||||
|
Loading…
x
Reference in New Issue
Block a user