Skip to content

Conversation

@vladd-bit
Copy link
Member

Potential fix for https://github.com/CogStack/ocr-service/security/code-scanning/2

To fix the problem, explicitly restrict the GITHUB_TOKEN permissions for this workflow. Since the job only needs to read repository contents (for actions/checkout), we can safely set contents: read at the workflow root. This will apply to all jobs (there is only one job, build) unless they override it.

Concretely:

  • Edit .github/workflows/run_tests.yml.
  • Add a permissions: block near the top, alongside name: and on:.
  • Set contents: read as a minimal, least-privilege permission. No steps in the current snippet indicate a need for write or other scopes.

Placement:

  • Insert the permissions block after the name: tests-ocr-service line and before the on: block, to make it clear that it applies to the whole workflow.

No additional methods, imports, or definitions are needed; this is purely a YAML configuration change.

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>
@vladd-bit vladd-bit marked this pull request as ready for review December 19, 2025 14:09
@vladd-bit vladd-bit merged commit aeec279 into main Dec 19, 2025
10 checks passed
@vladd-bit vladd-bit deleted the alert-autofix-2 branch December 19, 2025 14:09
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