use the same artifactClient.getArtifact structure as seen above in isSingleArtifactDownload logic

This commit is contained in:
GrantBirki 2025-04-17 12:18:37 -07:00
parent e463631f66
commit 171183c7dc
No known key found for this signature in database
GPG Key ID: 65497A530F6F9405

View File

@ -114,24 +114,22 @@ export async function run(): Promise<void> {
core.debug( core.debug(
`Only one artifact ID provided. Fetching latest artifact by its name and checking the ID` `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, inputs.name,
{...options} options
) )
if (!getArtifactResponse || !getArtifactResponse.artifact) { if (!targetArtifact) {
throw new Error( throw new Error(
`Artifact with ID '${artifactIds[0]}' not found. Please check the ID.` `Artifact with ID '${artifactIds[0]}' not found. Please check the ID.`
) )
} }
const artifact = getArtifactResponse.artifact
core.debug( 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 { } else {
core.info( core.info(
`Multiple artifact IDs provided. Fetching all artifacts to filter by ID` `Multiple artifact IDs provided. Fetching all artifacts to filter by ID`