Skip to content

Potential fix for code scanning alert no. 10: Workflow does not contain permissions#1459

Draft
Trouffman wants to merge 4 commits into
masterfrom
alert-autofix-10
Draft

Potential fix for code scanning alert no. 10: Workflow does not contain permissions#1459
Trouffman wants to merge 4 commits into
masterfrom
alert-autofix-10

Conversation

@Trouffman
Copy link
Copy Markdown
Collaborator

@Trouffman Trouffman commented May 2, 2026

Potential fix for https://github.com/DistroAV/DistroAV/security/code-scanning/10

Add an explicit top-level permissions block in .github/workflows/build-project.yaml so all jobs in this reusable workflow get least-privilege token scopes by default.

Best single fix without changing functionality:

  • Insert permissions: contents: read at workflow root, directly after the on: section (before jobs:).
  • This satisfies CodeQL’s minimum recommendation and supports current steps (checkout, cache, artifact upload) which do not require write access to repository contents.
  • No imports, methods, or dependencies are needed (YAML config only).

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Additional review & checks:

Build-Project Workflow :

contents: read
    Required for actions/checkout@v6 to fetch the repository code (and submodules, if private).

pull-requests: read
    In check-event job, for pull_request events seems to requires PR read permission.

actions: read
Required by actions/cache/* (restore/save) and actions/upload-artifact@v7 to interact with the Actions service (cache/artifacts).

Trouffman and others added 4 commits May 2, 2026 13:16
…in permissions

This aim to address a security trigger and prepare for tighter security practice.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Add permissions for content read access in workflow : check-format
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