Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Restore Cache succeeds with tar: Error opening archive message #33

@jeremysimmons

Description

@jeremysimmons

This log shows that the message tar: Error opening archive: Failed to open. Clearly the task did not succeed, but it is marked as such.

I believe the fault is with the failure to check the return code when calling tar in cacheUtilities.downloadCaches

shell.exec(`tar -xzf ${tarballPath} -C "${destinationFolder}"`);

try {
    tl.setVariable(hash, "true");
    // only if tar succeeds should we indicateit succeeded
    const success = shell.exec(`tar -xzf ${tarballPath} -C "${destinationFolder}"`).code == 0);
    // Set variable to track whether or not we downloaded cache (i.e. it already existed)
    tl.setVariable(output, success ? "true" : "false");
    return;
    }
} catch (err) {
    console.log(err);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions