File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,26 @@ export async function listActionsCaches(
229229 ) ;
230230}
231231
232+ /**
233+ * List the most recently created Actions cache entry across all refs that
234+ * match the provided key.
235+ */
236+ export async function getMostRecentActionsCacheEntry (
237+ key : string ,
238+ ) : Promise < ActionsCacheItem | undefined > {
239+ const repositoryNwo = getRepositoryNwo ( ) ;
240+
241+ const cacheItems = await getApiClient ( ) . rest . actions . getActionsCacheList ( {
242+ owner : repositoryNwo . owner ,
243+ repo : repositoryNwo . repo ,
244+ key,
245+ sort : "created_at" ,
246+ direction : "desc" ,
247+ per_page : 1 ,
248+ } ) ;
249+ return cacheItems . data . actions_caches [ 0 ] ;
250+ }
251+
232252/** Delete an Actions cache item by its ID. */
233253export async function deleteActionsCache ( id : number ) {
234254 const repositoryNwo = getRepositoryNwo ( ) ;
You can’t perform that action at this time.
0 commit comments