-
Notifications
You must be signed in to change notification settings - Fork 0
Potential fix for code scanning alert no. 1: Workflow does not contain permissions #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
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 a security code scanning alert by adding explicit permissions to the Ruff workflow, following the principle of least privilege. The change restricts the workflow's default permissions to read-only access, which is appropriate since this workflow only performs linting and formatting checks without requiring write access to the repository.
Key changes:
- Added
permissions: contents: readblock to restrict workflow permissions to minimal required level
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lukas-hoermann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one file changed, which is not part of the main code.
lukas-hoermann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one file changed, which is not part of the main code.
Pull Request Test Coverage Report for Build 19835074809Details
💛 - Coveralls |
Pull request was converted to draft
Potential fix for https://github.com/maurergroup/dfttoolkit/security/code-scanning/1
To fix the problem, we should add a
permissions:block at the root level of the workflow YAML (abovejobs:), thereby setting the minimal required permissions for all jobs. For this workflow, all tasks are read-only: Ruff linting and formatting jobs just analyze the source and produce local results, do not require pushing code, opening issues, or writing PRs. Therefore, the minimal permission required iscontents: read. The addition should be performed at the top level, after the workflownameand before or after theon:block, but beforejobs:. No further imports or method definitions are needed.Suggested fixes powered by Copilot Autofix. Review carefully before merging.