mirror of
https://github.com/stablyai/orca.git
synced 2026-10-29 16:17:51 +00:00
* perf(ci): pilot pnpm verification record caching on Linux * test(ci): review pnpm verification record in mobile cache audit * perf(ci): share Electron downloads and clean closed PR caches * test(ci): retain cache ordering checks for restore-only consumers * perf(ci): limit archive sharing rollout to primed Linux hosts
34 lines
1.0 KiB
YAML
34 lines
1.0 KiB
YAML
name: Clean closed PR caches
|
|
|
|
on:
|
|
pull_request_target:
|
|
types: [closed]
|
|
|
|
permissions:
|
|
actions: write
|
|
|
|
jobs:
|
|
clean:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
# No checkout: this runs trusted default-branch code, including for fork PRs.
|
|
- uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
const ref = `refs/pull/${context.payload.pull_request.number}/merge`
|
|
const caches = await github.paginate(github.rest.actions.getActionsCacheList, {
|
|
...context.repo, ref, per_page: 100
|
|
})
|
|
for (const cache of caches) {
|
|
if (cache.ref !== ref) throw new Error(`Unexpected cache ref: ${cache.ref}`)
|
|
try {
|
|
await github.rest.actions.deleteActionsCacheById({
|
|
...context.repo, cache_id: cache.id
|
|
})
|
|
} catch (error) {
|
|
if (error.status !== 404) throw error
|
|
}
|
|
}
|
|
core.info(`Removed ${caches.length} caches scoped to ${ref}`)
|