Skip to content

Conversation

@hsaito
Copy link
Owner

@hsaito hsaito commented Aug 25, 2025

Potential fix for https://github.com/hsaito/MyNumber.NET/security/code-scanning/2

The problem can be fixed by adding an explicit permissions block at the top workflow level or inside the relevant job. As this workflow only contains a single job (CodeQL-Build), we can add a permissions: block at the workflow level, immediately following the name: or after on: (anywhere at the root, before jobs:), or within the CodeQL-Build job. The minimal recommended permissions for CodeQL analysis are contents: read (to fetch code) and security-events: write (to upload analysis results). This ensures the GITHUB_TOKEN only has these specific permissions when running this workflow, following least privilege. This change can be made within .github/workflows/codeql-analysis.yml, by inserting the following block at the top level:

permissions:
  contents: read
  security-events: write

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>
@hsaito hsaito marked this pull request as ready for review August 25, 2025 06:48
@hsaito hsaito merged commit 26114d0 into master Aug 25, 2025
6 checks passed
@hsaito hsaito deleted the alert-autofix-2 branch August 25, 2025 06:49
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