Skip to content

Potential fix for code scanning alert no. 3: Workflow does not contain permissions#257

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

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

Conversation

@aram356
Copy link
Collaborator

@aram356 aram356 commented Feb 7, 2026

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

In general, the fix is to explicitly restrict the GITHUB_TOKEN in this workflow to the minimal permissions required. Since all the jobs only need to read the repository contents (for checkout, dependency resolution, and running tools) and do not write back to GitHub, we can safely declare contents: read at the top level of the workflow. Defining permissions at the workflow root applies to all jobs that don't have their own permissions block, which matches this file.

Concretely, edit .github/workflows/format.yml to add a permissions block near the top, alongside name and on. For example, add:

permissions:
  contents: read

between the name and on keys. No additional methods, imports, or steps are required; this only changes the token scope that GitHub automatically injects, without altering the existing job behavior.

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:14
@aram356 aram356 removed their assignment Feb 7, 2026
@aram356 aram356 self-assigned this Feb 7, 2026
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