Skip to content

Potential fix for code scanning alert no. 2: Workflow does not contain permissions#259

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

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

Conversation

@aram356
Copy link
Collaborator

@aram356 aram356 commented Feb 7, 2026

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

In general, the fix is to explicitly declare minimal GITHUB_TOKEN permissions in the workflow YAML, either globally (at the root) or per job, instead of relying on repository defaults. For this workflow, all jobs only need to read the repository contents and do not interact with PRs, issues, or write back to the repo, so contents: read is sufficient.

The best fix without changing behavior is to add a permissions block at the root level (just under name: and before on:). This ensures every job in this workflow uses the same restricted permissions and avoids having to repeat the block for each job. No additional imports or external actions are needed. Concretely, edit .github/workflows/format.yml and insert:

permissions:
  contents: read

after line 1 (the name: line). All other lines remain unchanged.

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:16
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