Skip to content

Commit 171183c

Browse files
committed
use the same artifactClient.getArtifact structure as seen above in isSingleArtifactDownload logic
1 parent e463631 commit 171183c

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/download-artifact.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,24 +114,22 @@ export async function run(): Promise<void> {
114114
core.debug(
115115
`Only one artifact ID provided. Fetching latest artifact by its name and checking the ID`
116116
)
117-
const getArtifactResponse = await artifactClient.getArtifact(
117+
const {artifact: targetArtifact} = await artifactClient.getArtifact(
118118
inputs.name,
119-
{...options}
119+
options
120120
)
121121

122-
if (!getArtifactResponse || !getArtifactResponse.artifact) {
122+
if (!targetArtifact) {
123123
throw new Error(
124124
`Artifact with ID '${artifactIds[0]}' not found. Please check the ID.`
125125
)
126126
}
127127

128-
const artifact = getArtifactResponse.artifact
129-
130128
core.debug(
131-
`Found artifact by ID '${artifact.name}' (ID: ${artifact.id}, Size: ${artifact.size})`
129+
`Found artifact by ID '${targetArtifact.name}' (ID: ${targetArtifact.id}, Size: ${targetArtifact.size})`
132130
)
133131

134-
artifacts = [artifact]
132+
artifacts = [targetArtifact]
135133
} else {
136134
core.info(
137135
`Multiple artifact IDs provided. Fetching all artifacts to filter by ID`

0 commit comments

Comments
 (0)