Proposal: scheduled workflow to open a PR for new GitHub advisories

Đang mở
#1,342 2 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 1 ngày

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
18/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, ruby
Lĩnh vực
ci-cd, security

Hướng nghiên cứu

This is a design proposal, so start by reading lib/my-process.txt and the rake sync_github_advisories task, which calls lib/rad-ignores.sh. Do not write the workflow until a maintainer picks one of the three delivery options in the issue, since that choice sets the credentials needed. Work is blocked on the prerequisite fixes #1339 and #1340 and on that decision.

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

Mô tả

I read through lib/my-process.txt looking for steps that could move to automation to lessen the burden on maintainers. I've found a number of opportunities, and this is the first one. Steps that need human judgment stay manual.


Summary

I'd like to propose a scheduled GitHub Actions workflow that runs the existing rake sync_github_advisories task and proposes the result for review. It does not change how advisories are reviewed or merged.

Proposed behavior

  • Runs once a day on a cron schedule, and on workflow_dispatch with an optional gem_name input.
  • Runs rake sync_github_advisories, which already runs lib/rad-ignores.sh, so known duplicates, withdrawn advisories and non-gems are not re-added.
  • If files changed, opens or updates a single rolling PR from a fixed branch (for example automation/github-advisory-sync). It never pushes to master.
  • If nothing changed, it does nothing.
  • Reading advisories needs only the built-in GITHUB_TOKEN.
  • Written to pass the existing actionlint and zizmor checks: SHA-pinned actions, permissions: {} at the top level, persist-credentials: false.

Prerequisite fixes (separate PRs)

  • Fix GitHubAdvisorySync.sync crashing with NoMethodError when no advisory is unchanged (compact! returns nil): #1339
  • Make lib/rad-ignores.sh work from any directory and checkout name: #1340

Question for maintainers: how should the result be delivered?

This decides what credentials are needed, so I'd like your preference before writing the workflow.

  1. PR using a PAT or GitHub App token stored as a secret (for example RAD_BOT_TOKEN). CI runs automatically on the PR. This needs a maintainer to create and store the credential.
  2. PR using GITHUB_TOKEN (no new secret). Requires enabling "Allow GitHub Actions to create and approve pull requests" in repo settings. GitHub does not run other workflows for PRs created this way, so ruby.yml (lint and schema checks) would not run until a maintainer closes and reopens the PR or pushes to it.
  3. Issue digest only. The workflow posts or updates an issue listing the new or changed advisory files, and a maintainer runs the sync themselves. No write access to code and no secret are needed.

I'm happy to implement whichever you prefer, and to drop the idea if it isn't wanted. I'm not a maintainer, so I'll test it on my fork first.

Ngôn ngữ chính
Ruby
Star
1.1k
Fork
257
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
58

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 tương tự

Thêm issue về Ruby

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.