mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-22 16:53:57 +08:00
more options
This commit is contained in:
parent
cbb243eff9
commit
9d956bc62d
4 changed files with 64 additions and 1 deletions
|
@ -182,6 +182,29 @@ export class CacheService {
|
|||
Prefix: path.join(this.getCacheFolder(), keys[i])
|
||||
})
|
||||
.promise();
|
||||
let selected: S3.Object | undefined = 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
|
||||
} catch {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue