mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-23 01:03:57 +08:00
more options
This commit is contained in:
parent
cbb243eff9
commit
9d956bc62d
4 changed files with 64 additions and 1 deletions
20
dist/restore/index.js
vendored
20
dist/restore/index.js
vendored
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue