Skip to content

Implement prlimit64 syscall (getrlimit/setrlimit support) #345

Implement prlimit64 syscall (getrlimit/setrlimit support)

Implement prlimit64 syscall (getrlimit/setrlimit support) #345

name: PR cache cleanup
on:
pull_request:
types: [closed]
permissions:
actions: write
contents: read
concurrency:
group: pr-cache-cleanup
cancel-in-progress: false
jobs:
purge:
runs-on: ubuntu-latest
steps:
- name: Delete caches scoped to this PR
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
with:
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const pr = context.payload.pull_request.number;
const refs = [`refs/pull/${pr}/merge`, `refs/pull/${pr}/head`];
for (const ref of refs) {
const { data } = await github.request(
'GET /repos/{owner}/{repo}/actions/caches',
{ owner, repo, ref, per_page: 100 }
);
if (data.total_count === 0) {
core.info(`No caches for ${ref}`);
continue;
}
for (const cache of data.actions_caches) {
core.info(`Deleting cache id ${cache.id} (key: ${cache.key})`);
await github.request(
'DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}',
{ owner, repo, cache_id: cache.id }
);
}
}