Skip to content

Potential fix for code scanning alert no. 8: Workflow does not contain permissions#33

Merged
amikhail48 merged 1 commit intomainfrom
alert-autofix-8
Mar 3, 2026
Merged

Potential fix for code scanning alert no. 8: Workflow does not contain permissions#33
amikhail48 merged 1 commit intomainfrom
alert-autofix-8

Conversation

@amikhail48
Copy link
Member

Potential fix for https://github.com/RunEdgeAI/coreflow/security/code-scanning/8

To fix the problem, explicitly declare restricted GITHUB_TOKEN permissions in the workflow, rather than inheriting repository defaults. The minimal set needed here is read-only access to repository contents, since the workflow only checks out code and uploads artifacts.

The best way to fix this without changing existing functionality is to add a top-level permissions block (aligned with name: and on:) specifying contents: read. This will apply to all jobs (cppcheck and clang-tidy) unless a job overrides it. No steps need write access to code, issues, or pull requests, and actions/checkout and actions/upload-artifact both work with contents: read (the latter doesn’t use GITHUB_TOKEN at all). Concretely, in .github/workflows/code_quality.yml, insert:

permissions:
  contents: read

between the name: Static Analysis line and the on: block. No imports or other definitions are required.

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>
@amikhail48 amikhail48 marked this pull request as ready for review March 3, 2026 19:53
@amikhail48 amikhail48 enabled auto-merge March 3, 2026 19:53
@amikhail48 amikhail48 disabled auto-merge March 3, 2026 19:54
@amikhail48 amikhail48 merged commit ebf3ea7 into main Mar 3, 2026
7 checks passed
@amikhail48 amikhail48 deleted the alert-autofix-8 branch March 3, 2026 19:54
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.

1 participant