Skip to content

Conversation

@lefty01
Copy link
Owner

@lefty01 lefty01 commented Jan 6, 2026

Potential fix for https://github.com/lefty01/ESP32_TTGO_FTMS/security/code-scanning/1

In general, to fix this issue you should add an explicit permissions block either at the workflow root (applies to all jobs) or inside the specific job that uses the GITHUB_TOKEN. This block should grant only the minimal scopes needed for the workflow to function.

For this workflow, the job needs to: (1) read repository contents (for actions/checkout and git ls-files), and (2) write comments to pull requests via marocchino/sticky-pull-request-comment. It doesn’t need to push commits, manage issues, or modify other resources. The best minimal permissions set is therefore: contents: read and pull-requests: write. To implement this without changing functionality, add a permissions mapping under the formatting-check job (same indentation level as runs-on, strategy, and steps). No additional imports or external methods are needed because this is a YAML configuration change only. The rest of the workflow remains unchanged.

Concretely, in .github/workflows/clang-format-check.yml, insert:

    permissions:
      contents: read
      pull-requests: write

between runs-on: ubuntu-latest and strategy: for the formatting-check job.

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>
@lefty01 lefty01 marked this pull request as ready for review January 6, 2026 21:22
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