Fallout-build / Fallout-build/Fallout.Extensions.VSCode

Purge a pull request's Actions caches when it closes

Abierto Apto para principiantes
#25 0 comentarios 0 reacciones 0 asignados Ver en GitHub
CD enhancement
Lenguaje dominante
C#
Estrellas
0
Forks
0
Merge medio
2 h 43 min
PR fusionados (30 d)
8

Descripción

### Problem
Actions caches created for a pull request are never deleted when that pull request closes. On 2026-08-19 this repository held 15 caches of about 209 MB each, roughly 3.1 GB. Every one of them belonged to a pull request that was already merged or closed, and all 15 shared the same cache key. Each repository on the Free plan gets 10 GB of cache. Filling it wastes the allowance and produces billing alert emails for the organisation.

### Outcome
When a pull request closes, the caches that belong only to that pull request are deleted automatically. No manual cleanup is needed.

### Acceptance criteria
- [ ] A workflow runs on `pull_request` with `types: [closed]`.
- [ ] It deletes every cache whose `ref` is `refs/pull//merge` for the pull request that just closed.
- [ ] It uses the built-in `GITHUB_TOKEN` with `permissions: actions: write`, not a personal access token.
- [ ] The run succeeds when the pull request has no caches.
- [ ] Caches on branch refs such as `refs/heads/main` and `refs/heads/develop` are not touched.

### Notes
- The 15 caches were deleted by hand on 2026-08-19.
- Because all 15 shared one cache key, each pull request stored a full copy of the same content. Worth checking whether the cache key needs to include the pull request ref at all.
- List caches with `GET /repos/{owner}/{repo}/actions/caches`, delete with `DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}`.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comience con la configuración del workflow de GitHub Actions del repositorio y los endpoints de caché documentados: GET /repos/{owner}/{repo}/actions/caches y DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}. Verifique que el workflow gestione el evento pull_request closed, use GITHUB_TOKEN con actions: write, elimine únicamente las cachés correspondientes a refs/pull//merge y tenga éxito cuando no exista ninguna.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
github, github-actions
Área
ci-cd
Tipo de issue
Nueva funcionalidad
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Activo
Claridad
Bien especificado
Aptitud para principiantes
76/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.