Skip to content

Potential fix for code scanning alert no. 4: Workflow does not contain permissions#6

Merged
N0tHorizon merged 1 commit into📦Currentfrom
alert-autofix-4
Sep 23, 2025
Merged

Potential fix for code scanning alert no. 4: Workflow does not contain permissions#6
N0tHorizon merged 1 commit into📦Currentfrom
alert-autofix-4

Conversation

@N0tHorizon
Copy link
Copy Markdown
Owner

Potential fix for https://github.com/N0tHorizon/WindowsTelemetryBlocker/security/code-scanning/4

To address the issue, add a top-level permissions block in .github/workflows/safety-check.yml, specifying only the permissions necessary for the workflow. Since none of the steps require any write access or GitHub API operations—only access to the repository contents to check scripts and documentation—all that is needed is contents: read. This setting should go at the root of the YAML file, just below the workflow name and before on: and jobs:. This adjustment strictly follows GitHub's security recommendation and CodeQL's suggestion.

Specifically:

  • Add a block:
    permissions:
      contents: read
  • Place it after the name declaration, e.g., between lines 1 and 3.

No other code, imports, or step modifications are required.


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>
@N0tHorizon N0tHorizon marked this pull request as ready for review September 23, 2025 19:20
@N0tHorizon N0tHorizon merged commit cc47ab8 into 📦Current Sep 23, 2025
5 checks passed
@N0tHorizon N0tHorizon deleted the alert-autofix-4 branch September 23, 2025 19:34
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.

1 participant