Skip to content

Potential fix for code scanning alert no. 4: Workflow does not contain permissions - #12

Merged
xlight merged 1 commit into
mainfrom
alert-autofix-4
Aug 17, 2026
Merged

Potential fix for code scanning alert no. 4: Workflow does not contain permissions#12
xlight merged 1 commit into
mainfrom
alert-autofix-4

Conversation

@xlight

@xlight xlight commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/xlight/deepseek-visionary/security/code-scanning/4

通用修复方式:在 workflow 根级或具体 job 下增加 permissions,仅授予必需权限。若不确定需要写权限,先设为只读最小集(如 contents: read),再按运行失败信息逐步加权限。

针对当前文件的最佳且最小变更:在 .github/workflows/zed-extension-release.ymlon: 块之后、jobs: 之前新增根级 permissions,设置为:

permissions:
  contents: read

这样不会改变现有业务逻辑(仍由 COMMITTER_TOKEN 完成写操作),同时满足 CodeQL 对显式权限声明的要求并降低 GITHUB_TOKEN 风险面。无需新增 import、方法或依赖。

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@xlight
xlight marked this pull request as ready for review August 17, 2026 22:03
Copilot AI lite review requested due to automatic review settings August 17, 2026 22:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses code scanning alert #4 (“Workflow does not contain permissions”) by explicitly declaring minimal GITHUB_TOKEN permissions in the Zed extension release workflow, reducing token risk surface while satisfying CodeQL’s expectation for explicit permissions.

Changes:

  • Add a top-level permissions block to the workflow.
  • Set contents: read as the minimal required permission for GITHUB_TOKEN.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@xlight
xlight merged commit a0c89b7 into main Aug 17, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants