Skip to content

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

Merged
aram356 merged 1 commit intomainfrom
security/alert-autofix-2
Feb 9, 2026
Merged

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

Conversation

@aram356
Copy link
Copy Markdown
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
@aram356 aram356 merged commit 2488be4 into main Feb 9, 2026
9 checks passed
@aram356 aram356 deleted the security/alert-autofix-2 branch February 9, 2026 21:35
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.

2 participants