Document that `pull_request` can upload SARIF without `security-events: write`
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 1/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 86/100
- Issue 類型
- 文件
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- github, github-actions
研究方向
更新 issue 中提到的程式碼掃描工作流程設定選項文章中的「誰可以使用這項功能?」章節。閱讀其連結的疑難排解指引,並比較 pull_request 的行為與需要 security-events: write 的 push 和 schedule 範例。完成標準是文章清楚說明 pull_request 執行不需要該權限即可上傳 SARIF,包括來自 fork 的提取要求。
由索引模型根據 Issue 內容生成。
描述
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/code-security/reference/code-scanning/workflow-configuration-options
What part(s) of the article would you like to see updated?
Who can use this feature?
Users with write access if advanced setup is already enabled
To mention that pull_requests magically have security-events: write or something functionally equivalent to it.
Additional information
Confirming the cause of the error
If you're using Dependabot in your code scanning workflow, investigate the scope it's using.Uploading code scanning results for a branch usually requires the
security-events: writescope. However, code scanning always allows the uploading of results when thepull_requestevent triggers the action run. This is why, for Dependabot branches, we recommend you use thepull_requestevent instead of thepushevent.
Hallucinations follow:
-
The Actions workflow syntax
explains why fork PR tokens are read-only.Using the permissions key for forked repositories
You can use thepermissionskey to add and removereadpermissions for forked repositories, but typically you can't grantwriteaccess. The exception to this behavior is where an admin user has selected the Send write tokens to workflows from pull requests option in the GitHub Actions settings. For more information, see Managing GitHub Actions settings for a repository.-- this strongly hints that it's the only exception.
-
The code-scanning workflow guide
describes scanning onpull_requestwithout discussing the upload permission exception.Scanning pull requests
The default CodeQL analysis workflow uses thepull_requestevent to trigger a code scan on pull requests targeted against the default branch. If a pull request is from a private fork, thepull_requestevent will only be triggered if you've selected the "Run workflows from fork pull requests" option in the repository settings. For more information, see Managing GitHub Actions settings for a repository.-- doesn't mention
permissions:at all -
The SARIF upload guide
labelssecurity-events: writeas “required for all workflows” in examples that run onpushandschedule.Who can use this feature?
Users with write accessCode scanning is available for the following repository types:
- Public repositories on GitHub.com
- Organization-owned repositories on GitHub Team, GitHub Enterprise Cloud, or GitHub Enterprise Server, with GitHub Code Security enabled.
-- doesn't mention
pull_requestat all- https://github.com/check-spelling-outlook/curly-giggle-ideal-garbanzo/pull/12
(https://github.com/check-spelling-outlook/curly-giggle-ideal-garbanzo/actions/runs/46330116831/job/141558162788)
is about what GitHub accepts from a job token:
A workflow triggered bypull_requestcan upload code-scanning results for that pull request usingGITHUB_TOKENeven when the token lackssecurity-events: write, including for pull requests from forks (by users who do not have an affiliation with the PR target repo).
- 主要語言
- TypeScript
- 星號
- 21.6k
- 分支
- 69.7k
- 平均合併
- 8 小時 11 分鐘
- 30 天內合併 PR
- 100
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/docs 的其他 Issue
-
Codespaces user secrets guide describes logout behavior from older GitHub CLI versions可能已有人在做 @Jostar2 今天認領。 未關閉triage
難度 1/5 1 小時以內 新手友好度 92/100
維護者通常 1 天內回覆
-
content localization
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
content localization
難度 1/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
Remove deprecated node20 option from Actions Metadata可能已有人在做 @Netail 於 11 天前認領。 未關閉content skip-spammy-check
難度 1/5 1 小時以內 新手友好度 70/100
維護者通常 1 天內回覆
-
SSH key pages: add the 3072-bit RSA rule and an ssh-keygen -lf check to the Note可能重新可做 關聯的 PR 已關閉且未合併。 未關閉builder persona content
難度 1/5 1-3 小時 新手友好度 88/100
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
eliasstravik/herdr-projects#1700 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 75/100
Koenkk/zigbee2mqtt#33890 ·
維護者通常 1 天內回覆
-
[bug] Socrates launchd-path adapter throws EISDIR when an import names a folder beside its .ts file未關閉
難度 2/5 1-3 小時 新手友好度 85/100
danielmiessler/LifeOS#3123 ·
維護者通常 5 天內回覆
-
[Feature]: Skill Workshop skill diet should use the configured utility model, not always the primary未關閉clawsweeper:fix-shape-clear clawsweeper:needs-live-repro clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:auth-provider issue-rating: 🐚 platinum hermit P2
難度 2/5 1-3 小時 新手友好度 84/100
openclaw/openclaw#210348 · 1 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆