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

9
dist/index.js vendored
View File

@ -118848,13 +118848,12 @@ function run() {
// if the length of artifactIds exactly 1 fetch the latest artifact by its name and check the ID // if the length of artifactIds exactly 1 fetch the latest artifact by its name and check the ID
if (artifactIds.length === 1) { if (artifactIds.length === 1) {
core.debug(`Only one artifact ID provided. Fetching latest artifact by its name and checking the ID`); core.debug(`Only one artifact ID provided. Fetching latest artifact by its name and checking the ID`);
const getArtifactResponse = yield artifact_1.default.getArtifact(inputs.name, Object.assign({}, options)); const { artifact: targetArtifact } = yield artifact_1.default.getArtifact(inputs.name, options);
if (!getArtifactResponse || !getArtifactResponse.artifact) { if (!targetArtifact) {
throw new Error(`Artifact with ID '${artifactIds[0]}' not found. Please check the ID.`); throw new Error(`Artifact with ID '${artifactIds[0]}' not found. Please check the ID.`);
} }
const artifact = getArtifactResponse.artifact; core.debug(`Found artifact by ID '${targetArtifact.name}' (ID: ${targetArtifact.id}, Size: ${targetArtifact.size})`);
core.debug(`Found artifact by ID '${artifact.name}' (ID: ${artifact.id}, Size: ${artifact.size})`); artifacts = [targetArtifact];
artifacts = [artifact];
} }
else { else {
core.info(`Multiple artifact IDs provided. Fetching all artifacts to filter by ID`); core.info(`Multiple artifact IDs provided. Fetching all artifacts to filter by ID`);