Skip to content

Conversation

@DefinitelyADev
Copy link
Owner

Potential fix for https://github.com/DefinitelyADev/custom-areas-integration/security/code-scanning/14

To fix this problem, we need to explicitly add a permissions block to the workflow YAML file. The best way is to add this at the root level (before jobs:), which will apply to all jobs unless a job defines more specific permissions. For this workflow, the steps involve checking out code and running pre-commit hooks, which only require contents: read permissions for the GITHUB_TOKEN (unless the workflow is writing to issues, pull requests, etc., which is not shown here). Therefore, set the permissions root block as:

permissions:
  contents: read

This change should be made to .github/workflows/pre-commit.yml immediately after the workflow name and before the on: block.

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>
@DefinitelyADev DefinitelyADev marked this pull request as ready for review September 21, 2025 22:02
@DefinitelyADev DefinitelyADev merged commit e4d9d02 into master Sep 21, 2025
13 checks passed
@DefinitelyADev DefinitelyADev deleted the alert-autofix-14 branch September 21, 2025 22:02
@DefinitelyADev DefinitelyADev added this to the 1.2.1 milestone Sep 21, 2025
@DefinitelyADev DefinitelyADev added the enhancement New feature or request label Sep 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants