Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Purge a pull request's Actions caches when it closes

Đang mở Phù hợp với người mới
#649 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions
Lĩnh vực
ci-cd

Hướng nghiên cứu

Bắt đầu bằng cách kiểm tra các tệp workflow của repository và GitHub Actions cache API được mô tả trong issue. Xác nhận rằng workflow xử lý việc đóng pull_request, sử dụng GITHUB_TOKEN với actions: write, chỉ xóa các cache cho merge ref của pull request đang được đóng, vẫn thành công khi không có cache phù hợp và giữ nguyên các cache của branch-ref.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

CD enhancement
Problem

Actions caches created for a pull request are never deleted when that pull request closes. They stay until GitHub evicts them after 7 days of no access. On 2026-08-19 this organisation held 5.95 GB of caches, and 4.3 GB of that was unused caches belonging to pull requests that were already merged or closed. Each repository on the Free plan gets 10 GB of cache. Filling it wastes the allowance and produces billing alert emails.

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/<number>/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/release/* are not touched.
Notes
  • One cache on this repository was 589 MB for a single pull request (#640). It was deleted by hand on 2026-08-19.
  • List caches with GET /repos/{owner}/{repo}/actions/caches, delete with DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}.
  • The same problem exists in Fallout.Extensions.VSCode, tracked in Fallout-build/Fallout.Extensions.VSCode#25.
Ngôn ngữ chính
C#
Star
169
Fork
21
Merge trung bình
3 ngày 7 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Fallout-build/Fallout

Tất cả issue của Fallout-build/Fallout

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.