Skip to content

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

Merged
achamayou merged 2 commits intomainfrom
alert-autofix-8
Feb 12, 2026
Merged

Potential fix for code scanning alert no. 8: Workflow does not contain permissions#24
achamayou merged 2 commits intomainfrom
alert-autofix-8

Conversation

@achamayou
Copy link
Member

Potential fix for https://github.com/microsoft/merklecpp/security/code-scanning/8

In general, the fix is to add an explicit permissions: block either at the workflow root (applies to all jobs) or at the job level (applies only to that job), restricting GITHUB_TOKEN to the least privileges required. This workflow only checks out code and runs build/test commands, so contents: read is sufficient.

The minimal and clearest change, without altering functionality, is to add a workflow-level permissions: block after the on: section and before jobs: in .github/workflows/ci.yml:

  • Add:
    permissions:
      contents: read
    at the root level of the workflow file (same indentation as on: and jobs:).

No additional methods, imports, or definitions are needed; this is purely a YAML configuration change.

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>
@achamayou achamayou marked this pull request as ready for review February 12, 2026 09:40
@achamayou achamayou merged commit 5694aed into main Feb 12, 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.

1 participant