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

Purge a pull request's Actions caches when it closes

オープン 初心者向け
#25 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
CD enhancement
主要言語
C#
スター
0
フォーク
0
平均マージ
2時間 43分
マージ済み PR(30日)
8

説明

### 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}`.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リポジトリの GitHub Actions ワークフロー設定と、文書化されているキャッシュエンドポイント GET /repos/{owner}/{repo}/actions/caches および DELETE /repos/{owner}/{repo}/actions/caches/{cache_id} から始めます。ワークフローが pull_request closed イベントを処理し、actions: write を付与した GITHUB_TOKEN を使用し、一致する refs/pull//merge キャッシュのみを削除し、存在しない場合にも成功することを確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
github, github-actions
領域
ci-cd
issue の種類
機能追加
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
76/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。