Skip to content

Conversation

@tobitege
Copy link
Owner

Potential fix for https://github.com/tobitege/OpenSourceToolkit.NET/security/code-scanning/3

To fix the problem, add explicit permissions blocks to all jobs that currently rely on default permissions. For jobs that only need to read the repository (e.g., validate and build-desktop), set contents: read. Keep the existing contents: write on the publish job, since it likely needs to create tags and releases. This aligns each job with least privilege and satisfies CodeQL.

Concretely:

  • In .github/workflows/release.yml, under jobs.validate, add:
    • permissions: contents: read
  • In .github/workflows/release.yml, under jobs.build-desktop, add:
    • permissions: contents: read
  • Leave the existing permissions block in publish unchanged.

No additional imports, methods, or external libraries are required; this is purely a workflow 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>
@tobitege tobitege marked this pull request as ready for review December 20, 2025 04:22
@tobitege tobitege merged commit c19a607 into main Dec 20, 2025
5 checks passed
@tobitege tobitege deleted the alert-autofix-3 branch December 20, 2025 04:27
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