Encode cageids to enable address translations: (arg, cageid) tuple independence from calling cages.
#344
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 } | |
| ); | |
| } | |
| } |