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

未關閉
#1,342 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
18/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
活躍
技術堆疊
github-actions, ruby
領域
ci-cd, security

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
Ruby
星號
1.1k
分支
257
平均合併
1 天 23 小時
30 天內合併 PR
58

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

相似的 Issue

更多 Ruby Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。