mirror of
				https://github.com/actions/download-artifact.git
				synced 2025-10-31 19:33:40 +00: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( |       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` | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user