Skip to content

Conversation

@derrabauke
Copy link
Contributor

Potential fix for https://github.com/projectcaluma/ember-emeis/security/code-scanning/3

In general, the fix is to explicitly set permissions for the workflow or for each job to ensure the GITHUB_TOKEN has only the minimal required privileges. Since these jobs only need to read the repository contents (for actions/checkout and to run code), we can set contents: read. Doing this at the workflow root is simplest and applies to all jobs that lack their own permissions block, matching the CodeQL suggestion and preserving existing behavior.

The best change here is to add a single permissions: block at the top level of .github/workflows/test.yml, just below the on: section (or just after it) so it clearly applies to all jobs. We’ll set:

permissions:
  contents: read

No job-specific modifications or additional imports are needed. Functionality remains unchanged, but the GITHUB_TOKEN will now be restricted to read-only repository contents for all jobs in this workflow.

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