more options

This commit is contained in:
Caleb Gosiak 2021-09-30 18:05:21 -05:00
parent cbb243eff9
commit 9d956bc62d
4 changed files with 64 additions and 1 deletions

20
dist/restore/index.js vendored
View file

@ -43417,6 +43417,26 @@ class CacheService {
Prefix: path.join(this.getCacheFolder(), keys[i])
})
.promise();
let selected = undefined;
if (response.Contents) {
for (const object of response.Contents) {
if (selected === undefined) {
selected = object;
}
else {
if (object.LastModified &&
selected.LastModified) {
if (object.LastModified >
selected.LastModified) {
selected = object;
}
}
}
}
if (selected && selected.Key) {
return path.parse(selected.Key).name;
}
}
core.debug(JSON.stringify(response));
// eslint-disable-next-line no-empty
}