Potential fix for code scanning alert no. 4: Workflow does not contain permissions - #12
Merged
Conversation
…n permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
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
permissionsblock to the workflow. - Set
contents: readas the minimal required permission forGITHUB_TOKEN.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Potential fix for https://github.com/xlight/deepseek-visionary/security/code-scanning/4
通用修复方式:在 workflow 根级或具体 job 下增加
permissions,仅授予必需权限。若不确定需要写权限,先设为只读最小集(如contents: read),再按运行失败信息逐步加权限。针对当前文件的最佳且最小变更:在
.github/workflows/zed-extension-release.yml的on:块之后、jobs:之前新增根级permissions,设置为:这样不会改变现有业务逻辑(仍由
COMMITTER_TOKEN完成写操作),同时满足 CodeQL 对显式权限声明的要求并降低GITHUB_TOKEN风险面。无需新增 import、方法或依赖。Suggested fixes powered by Copilot Autofix. Review carefully before merging.