Skip to content

Potential fix for code scanning alert no. 5: Workflow does not contain permissions#261

Open
aram356 wants to merge 1 commit intomainfrom
security/alert-autofix-5
Open

Potential fix for code scanning alert no. 5: Workflow does not contain permissions#261
aram356 wants to merge 1 commit intomainfrom
security/alert-autofix-5

Conversation

@aram356
Copy link
Collaborator

@aram356 aram356 commented Feb 7, 2026

Potential fix for https://github.com/IABTechLab/trusted-server/security/code-scanning/5

To fix the problem, explicitly restrict the GITHUB_TOKEN permissions for this workflow instead of relying on repository/organization defaults. Since all three jobs only need to read the repository contents and do local formatting/linting, the minimal required permission is contents: read.

The best way to do this without changing existing functionality is to add a single top‑level permissions block in .github/workflows/format.yml, right after the on: section and before jobs:. This will apply to all jobs in the workflow because none of them currently define their own permissions. Concretely, insert:

permissions:
  contents: read

at the root level (same indentation as on: and jobs:). No additional imports, methods, or other definitions are needed; this is a pure YAML configuration change that does not affect how the steps run, only the scope of the GITHUB_TOKEN.

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>
@aram356 aram356 self-assigned this Feb 7, 2026
@aram356 aram356 marked this pull request as ready for review February 7, 2026 00:23
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