Potential fix for code scanning alert no. 2: Workflow does not contain permissions#75
Potential fix for code scanning alert no. 2: Workflow does not contain permissions#75glenn-jocher merged 2 commits intomainfrom
Conversation
…n permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
|
👋 Hello @glenn-jocher, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Clean PR. The added top-level permissions block scopes the stale workflow to the expected minimum access for managing stale issues and pull requests, and I don't see any functional or security issues in this diff.
|
Merged — thank you, @glenn-jocher! 🎉 As Leonardo da Vinci said, “Simplicity is the ultimate sophistication.” This PR reflects that well: cleaner docstrings, tidier string formatting, and clearer workflow permissions all strengthen the repo’s readability, maintainability, and day-to-day reliability without changing core behavior. Really appreciate the thoughtful cleanup here — these low-risk improvements make a meaningful difference for both contributors and long-term project health. |
Potential fix for https://github.com/ultralytics/xview-yolov3/security/code-scanning/2
Add an explicit
permissionsblock to.github/workflows/stale.ymlso theGITHUB_TOKENhas only the scopes needed by this workflow.Best fix here: define permissions at the workflow root (applies to all jobs unless overridden), with the minimum required for
actions/stalebehavior in this file:contents: read(safe baseline)issues: write(comment/label/close issues)pull-requests: write(comment/label/close PRs)Edit region: near the top-level keys, immediately after
on:(or beforejobs:) to keep structure clear and avoid changing job logic.No imports, methods, or additional definitions are needed.
Suggested fixes powered by Copilot Autofix. Review carefully before merging.
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
🧹 This PR mainly cleans up documentation and string formatting across the repo, while also improving GitHub automation permissions for stale issue/PR handling.
📊 Key Changes
.github/workflows/stale.yml:contents: readissues: writepull-requests: writescoring/evaluation.pyscoring/matching.pyscoring/score.pyutils/datasets.pyutils/utils.pyutils/datasets.pyby renaming shape values to_h, _w, _🎯 Purpose & Impact