Skip to content

Conversation

@dermatz
Copy link
Collaborator

@dermatz dermatz commented Jan 21, 2026

Potential fix for https://github.com/OpenForgeProject/mageforge/security/code-scanning/4

In general, fix this by explicitly defining a permissions block that limits the GITHUB_TOKEN to the minimal scopes required. Place it either at the top level of the workflow (applies to all jobs) or under the specific job (functional-tests). Since this workflow has only one job and no steps need to write to the repository or PRs, the minimal safe configuration is contents: read. If you’re confident the job does not need the token at all, you could set permissions: {} to fully disable it, but to align with the CodeQL suggestion and common practice, using contents: read is appropriate.

Concretely, edit .github/workflows/functional-tests.yml and insert a top‑level permissions: block after the name: and on: sections and before jobs:. The block should be:

permissions:
  contents: read

No additional methods, imports, or dependencies are required; this is a pure YAML configuration change to the GitHub Actions workflow.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@dermatz dermatz marked this pull request as ready for review January 21, 2026 12:59
@dermatz dermatz requested a review from Morgy93 January 21, 2026 12:59
@dermatz dermatz enabled auto-merge (squash) January 21, 2026 12:59
@dermatz dermatz changed the title Potential fix for code scanning alert no. 4: Workflow does not contain permissions fix: workflow permissions Jan 21, 2026
@dermatz dermatz changed the title fix: workflow permissions ci: workflow permissions Jan 21, 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.

2 participants